diff --git a/config/container/Dockerfile b/config/container/Dockerfile index 5f17025..dda1514 100644 --- a/config/container/Dockerfile +++ b/config/container/Dockerfile @@ -51,11 +51,18 @@ RUN chown root:root /usr/local/bin/fixuid \ && printf "user: build\ngroup: build\npaths:\n - /\n - /home/build/build\n" > /etc/fixuid/config.yml ENTRYPOINT ["/usr/local/bin/fixuid", "-q"] -## Install packages from packages.list +## Install packages from packages.list with retry +ADD config/container/sources.list /etc/apt/sources.list ADD config/container/packages.list /etc/apt/packages.list -RUN apt update -y \ - && apt install -y $(cat /etc/apt/packages.list) \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN echo ' \ + set -e; \ + apt-get update; \ + until apt-get install -y $(cat /etc/apt/packages.list); do \ + echo "apt install failed. Likely throttled. Retrying in 10 mins..."; \ + sleep 600; \ + done; \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;' \ +| bash ## Create build user with sudo privs RUN useradd -G plugdev,sudo -ms /bin/bash build \ diff --git a/config/container/sources.list b/config/container/sources.list new file mode 100644 index 0000000..ffa6cf4 --- /dev/null +++ b/config/container/sources.list @@ -0,0 +1,3 @@ +deb http://snapshot.debian.org/archive/debian/20200722T000000Z buster main +deb http://snapshot.debian.org/archive/debian-security/20200722T000000Z buster/updates main +deb http://snapshot.debian.org/archive/debian/20200722T000000Z buster-updates main