From 3bcc2213af1d15803d2fb76d7bfdb774aca45b2d Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 5 Nov 2026 14:56:30 +0200 Subject: [PATCH] fix: clone ffmpeg from GitHub instead of fetching ffmpeg.org ffmpeg.org resets or times out connections from GitHub Actions runners, and curl retries do not outlast it. Clone the release tag from the GitHub mirror with a shallow checkout, the same way the swoole stage already builds its pinned source. The Renovate rule already tracks FFmpeg/FFmpeg tags with the n prefix, so the pin keeps updating. Co-Authored-By: Claude Fable 5.1 --- Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 68c8b69..061e6e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,15 +9,14 @@ FROM php:${PHP_VERSION}-cli-alpine AS ffmpeg ARG FFMPEG_VERSION RUN apk add --no-cache \ - build-base nasm pkgconf curl xz \ + build-base nasm pkgconf git \ x264-dev x265-dev libvpx-dev opus-dev lame-dev zlib-dev \ libtheora-dev libvorbis-dev -RUN curl -fsSL --retry 5 --retry-all-errors --retry-delay 5 \ - -o /tmp/ffmpeg.tar.xz "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.xz" \ - && tar -xJf /tmp/ffmpeg.tar.xz -C /tmp \ - && rm /tmp/ffmpeg.tar.xz \ - && cd "/tmp/ffmpeg-${FFMPEG_VERSION}" \ +# Cloned from the GitHub mirror at the release tag, like swoole below. ffmpeg.org +# resets or times out connections from CI runners, and retries do not outlast it. +RUN git clone --depth 1 --branch "n${FFMPEG_VERSION}" https://github.com/FFmpeg/FFmpeg.git /tmp/ffmpeg \ + && cd /tmp/ffmpeg \ && ./configure \ --prefix=/opt/ffmpeg \ --enable-gpl \ @@ -34,7 +33,7 @@ RUN curl -fsSL --retry 5 --retry-all-errors --retry-delay 5 \ && make -j"$(nproc)" \ && make install \ && /opt/ffmpeg/bin/ffmpeg -version \ - && rm -rf "/tmp/ffmpeg-${FFMPEG_VERSION}" + && rm -rf /tmp/ffmpeg # Built from source, pinned, in its own stage so it compiles alongside ffmpeg # rather than after it. Only the tests need it: the library itself has no swoole