lock debian sources to snapshots with auto retry

This commit is contained in:
Lance Vick 2020-07-23 01:33:05 -07:00
parent 25dcaab742
commit 22c9edfa67
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
2 changed files with 14 additions and 4 deletions

View File

@ -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 \

View File

@ -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