From e8ab6fa0164ab4e10246f4e215d467a843475794 Mon Sep 17 00:00:00 2001 From: Dostoievski Batista Date: Tue, 25 Mar 2025 12:07:51 -0300 Subject: [PATCH] Add apt retry configuration Sometimes the deb.debian.org reset the connection making the image build fail. This change adds a file that makes apt-get install retries at least 3 times before failing. Test plan: PASS - Run stx-init-env --rebuild PASS - Run stx-init-env with deb.debian.org inaccessible, see if retries happens Partial-Bug: 2103621 Change-Id: I6d2d1e7fa1ec2a85c56546e0be5bd261222ea184 Signed-off-by: Dostoievski Batista --- stx/dockerfiles/stx-aptly.Dockerfile | 3 +++ stx/dockerfiles/stx-builder.Dockerfile | 3 +++ stx/dockerfiles/stx-lat-tool.Dockerfile | 3 +++ stx/dockerfiles/stx-pkgbuilder.Dockerfile | 3 +++ 4 files changed, 12 insertions(+) diff --git a/stx/dockerfiles/stx-aptly.Dockerfile b/stx/dockerfiles/stx-aptly.Dockerfile index 6af383912..6fa2c5195 100644 --- a/stx/dockerfiles/stx-aptly.Dockerfile +++ b/stx/dockerfiles/stx-aptly.Dockerfile @@ -33,6 +33,9 @@ MAINTAINER mark.asselstine@windriver.com COPY --from=builder /go/nginx_signing.key nginx_signing.key +# Add retry to apt config +RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/99custom + # Update certificates RUN apt-get -q -y update && apt-get -y install --no-install-recommends ca-certificates && update-ca-certificates diff --git a/stx/dockerfiles/stx-builder.Dockerfile b/stx/dockerfiles/stx-builder.Dockerfile index a80cf5657..6de30eea9 100644 --- a/stx/dockerfiles/stx-builder.Dockerfile +++ b/stx/dockerfiles/stx-builder.Dockerfile @@ -21,6 +21,9 @@ RUN echo "deb-src http://deb.debian.org/debian bullseye main" >> /etc/apt/source echo "deb-src http://deb.debian.org/debian buster main" >> /etc/apt/sources.list && \ echo "deb http://deb.debian.org/debian bullseye contrib" >> /etc/apt/sources.list +# Add retry to apt config +RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/99custom + # Update certificates RUN apt-get -y update && apt-get -y install --no-install-recommends ca-certificates && update-ca-certificates diff --git a/stx/dockerfiles/stx-lat-tool.Dockerfile b/stx/dockerfiles/stx-lat-tool.Dockerfile index 437783572..c5a23a49e 100644 --- a/stx/dockerfiles/stx-lat-tool.Dockerfile +++ b/stx/dockerfiles/stx-lat-tool.Dockerfile @@ -19,6 +19,9 @@ MAINTAINER Chen Qi ARG STX_MIRROR_URL=https://mirror.starlingx.windriver.com/mirror ARG LAT_BINARY_RESOURCE_PATH=${STX_MIRROR_URL}/lat-sdk/lat-sdk-20231206 +# Add retry to apt config +RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/99custom + # Update certificates RUN apt-get -y update && apt-get -y install --no-install-recommends ca-certificates && update-ca-certificates diff --git a/stx/dockerfiles/stx-pkgbuilder.Dockerfile b/stx/dockerfiles/stx-pkgbuilder.Dockerfile index 280673e1c..15d5254df 100644 --- a/stx/dockerfiles/stx-pkgbuilder.Dockerfile +++ b/stx/dockerfiles/stx-pkgbuilder.Dockerfile @@ -20,6 +20,9 @@ ARG DEBIAN_SNAPSHOT_BASE=${STX_MIRROR_URL}/debian/debian/snapshot.debian.org/arc RUN echo "deb-src http://deb.debian.org/debian bullseye main" >> /etc/apt/sources.list ARG DEBIAN_FRONTEND=noninteractive +# Add retry to apt config +RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/99custom + # Update certificates RUN apt-get -y update && apt-get -y install --no-install-recommends ca-certificates && update-ca-certificates