We currently have the snapshot mirrors in the debian sources list. While
this in general is good to have a stable baseline for installing
additional packages, it is problematic in case the container gets older
and components become outdated (e.g. the ca-certificates). By restoring
the original debian mirror entries, we make it easier for our users to
keep things up to date by just running apt-update.
Signed-off-by: Felix Moessbauer <
felix.mo...@siemens.com>
---
Dockerfile | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/Dockerfile b/Dockerfile
index f508777ad..0e8d7c0ef 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -39,7 +39,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=${CACHE_SHARING} \
rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-packages.conf && \
if echo "${DEBIAN_TAG}" | grep -q "[0-9]"; then \
- sed -i -e '/^URIs:/d' -e 's|^#
http://snapshot\.|URIs:
http://snapshot.|' \
+ sed -i -e 's|^URIs:|#|' -e 's|^#
http://snapshot\.|URIs:
http://snapshot.|' \
/etc/apt/sources.list.d/debian.sources; \
echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/use-snapshot.conf; \
echo 'Acquire::Retries "10";' >> /etc/apt/apt.conf.d/use-snapshot.conf; \
@@ -113,6 +113,12 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=${CACHE_SHARING} \
python3-botocore \
bubblewrap \
debootstrap && \
+ rm -f /etc/apt/apt.conf.d/use-snapshot.conf /etc/apt/apt.conf.d/keep-packages.conf && \
+ sed -i \
+ -e 's|^#\(.*\)|@@TMP@@\1|' \
+ -e 's|^URIs:\(.*\)|#\1|' \
+ -e 's|@@TMP@@\(.*\)|URIs:\1|' \
+ /etc/apt/sources.list.d/debian.sources && \
rm -rf /var/log/* /tmp/* /var/tmp/* /var/cache/ldconfig/aux-cache && \
sbuild-adduser builder && \
sed -i 's|# kas-isar: ||g' /container-entrypoint
@@ -140,6 +146,12 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=${CACHE_SHARING} \
gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1 libsdl1.2-dev \
pylint xterm python3-subunit mesa-common-dev zstd lz4 && \
+ rm -f /etc/apt/apt.conf.d/use-snapshot.conf /etc/apt/apt.conf.d/keep-packages.conf && \
+ sed -i \
+ -e 's|^#\(.*\)|@@TMP@@\1|' \
+ -e 's|^URIs:\(.*\)|#\1|' \
+ -e 's|@@TMP@@\(.*\)|URIs:\1|' \
+ /etc/apt/sources.list.d/debian.sources && \
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
apt-get install --no-install-recommends -y gcc-multilib g++-multilib; \
fi && \
--
2.51.0