Skip to content

Commit 3f358ff

Browse files
committed
Add retries to the Docker build
The arm64 ubuntu apt repo `ports.ubuntu.com` is slow, overloaded, and prone to failing randomly. This adds a retry to the pulls so the build might succeed eventually. Longer term we should introduce caching and even maybe a local mirror. For now this hopefully makes the build more reliable.
1 parent b3af418 commit 3f358ff

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

portable.Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ ENV DEBIAN_FRONTEND=noninteractive \
88
# Prepare directories
99
WORKDIR /code
1010

11+
# Make apt resilient to transient ports.ubuntu.com mirror failures
12+
RUN printf 'Acquire::Retries "6";\nAcquire::http::Timeout "30";\n' \
13+
> /etc/apt/apt.conf.d/99-retries
14+
1115
# Copy everything
1216
COPY . ./
1317

@@ -40,6 +44,10 @@ COPY --from=builder /code /code
4044

4145
ENV PATH="/code/venv/bin:$PATH"
4246

47+
# Make apt resilient to transient ports.ubuntu.com mirror failures
48+
RUN printf 'Acquire::Retries "6";\nAcquire::http::Timeout "30";\n' \
49+
> /etc/apt/apt.conf.d/99-retries
50+
4351
# Install shared libraries that we depend on via APT, but *not*
4452
# the -dev packages to save space!
4553
# Also run a smoke test on ODM and OpenSfM

0 commit comments

Comments
 (0)