Add retry logic for external dependency downloads in Dockerfile #3

Open
opened 2026-02-28 21:39:57 +01:00 by timothy · 0 comments
Owner

Problem

Build run #6 failed because download.savannah.gnu.org returned HTTP 502 when downloading freetype-2.13.3.tar.gz (Dockerfile line 175). The URL works intermittently — GNU Savannah mirrors are unreliable and frequently return transient errors.

#13 1.047 curl: (22) The requested URL returned error: 502
#13 1.047 gzip: stdin: unexpected end of file
#13 1.047 tar: Child returned status 1

The Dockerfile has ~74 build steps, many of which download source tarballs from external servers (freetype, fribidi, fontconfig, lame, nv-codec-headers, etc). Any single transient failure kills the entire build with no recovery.

Impact

  • 30+ minute builds wasted on transient network errors
  • No automatic recovery — requires manual re-trigger
  • Multiple download sources are affected (GNU Savannah, SourceForge, GitHub releases)

Suggested fix

Add --retry 3 --retry-delay 5 to all curl commands in the Dockerfile. This handles transient 5xx errors without making the Dockerfile significantly more complex.

Example:

# Before
RUN curl -Lf https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE}.tar.gz | tar -zx ...

# After
RUN curl -Lf --retry 3 --retry-delay 5 https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE}.tar.gz | tar -zx ...

This should be applied to every curl invocation in the Dockerfile.

## Problem Build run #6 failed because `download.savannah.gnu.org` returned HTTP 502 when downloading freetype-2.13.3.tar.gz (Dockerfile line 175). The URL works intermittently — GNU Savannah mirrors are unreliable and frequently return transient errors. ``` #13 1.047 curl: (22) The requested URL returned error: 502 #13 1.047 gzip: stdin: unexpected end of file #13 1.047 tar: Child returned status 1 ``` The Dockerfile has ~74 build steps, many of which download source tarballs from external servers (freetype, fribidi, fontconfig, lame, nv-codec-headers, etc). Any single transient failure kills the entire build with no recovery. ## Impact - 30+ minute builds wasted on transient network errors - No automatic recovery — requires manual re-trigger - Multiple download sources are affected (GNU Savannah, SourceForge, GitHub releases) ## Suggested fix Add `--retry 3 --retry-delay 5` to all `curl` commands in the Dockerfile. This handles transient 5xx errors without making the Dockerfile significantly more complex. Example: ```dockerfile # Before RUN curl -Lf https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE}.tar.gz | tar -zx ... # After RUN curl -Lf --retry 3 --retry-delay 5 https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE}.tar.gz | tar -zx ... ``` This should be applied to every `curl` invocation in the Dockerfile.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: timothy/ersatztv-ffmpeg#3