-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile.ubuntu-2404
19 lines (19 loc) · 1.17 KB
/
Dockerfile.ubuntu-2404
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Base image must be Ubuntu 23.10 (Mantic Minotaur) or later: https://salsa.debian.org/apt-team/apt/-/merge_requests/291
FROM ubuntu:noble-20240407.1
ENV DEBIAN_FRONTEND=noninteractive
RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
: "${SOURCE_DATE_EPOCH:=$(stat --format=%Y /etc/apt/sources.list.d/ubuntu.sources)}" && \
snapshot="$(/bin/bash -euc "printf \"%(%Y%m%dT%H%M%SZ)T\n\" \"${SOURCE_DATE_EPOCH}\"")" && \
: "Enabling snapshot" && \
sed -i -e '/Types: deb/ a\Snapshot: true' /etc/apt/sources.list.d/ubuntu.sources && \
: "Enabling cache" && \
rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache && \
: "Fetching the snapshot and installing ca-certificates in one command" && \
apt-get install --update --snapshot "${snapshot}" -o Acquire::Check-Valid-Until=false -o Acquire::https::Verify-Peer=false -y ca-certificates && \
: "Installing gcc" && \
apt-get install --snapshot "${snapshot}" -y gcc && \
: "Clean up for improving reproducibility (optional)" && \
rm -rf /var/log/* /var/cache/ldconfig/aux-cache