diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3ff41dc..e6cc06d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -47,9 +47,9 @@ jobs: - "Dockerfile.debian-11" - "Dockerfile.debian-12" - "Dockerfile.ubuntu-2204" - - "Dockerfile.ubuntu-2304" + - "Dockerfile.ubuntu-2404" - "alternative/Dockerfile.debian-13" - - "alternative/Dockerfile.ubuntu-2310" + - "alternative/Dockerfile.ubuntu-2404" steps: - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v2 diff --git a/Dockerfile.ubuntu-2304 b/Dockerfile.ubuntu-2404 similarity index 91% rename from Dockerfile.ubuntu-2304 rename to Dockerfile.ubuntu-2404 index 7111e53..875ad56 100644 --- a/Dockerfile.ubuntu-2304 +++ b/Dockerfile.ubuntu-2404 @@ -1,4 +1,4 @@ -FROM ubuntu:lunar-20230816 +FROM ubuntu:noble-20240407.1 ENV DEBIAN_FRONTEND=noninteractive RUN \ --mount=type=cache,target=/var/cache/apt,sharing=locked \ diff --git a/README.md b/README.md index 28377fb..23a043e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Examples: - [`Dockerfile.debian-11`](./Dockerfile.debian-11) - [`Dockerfile.debian-12`](./Dockerfile.debian-12) - [`Dockerfile.ubuntu-2204`](./Dockerfile.ubuntu-2204) -- [`Dockerfile.ubuntu-2304`](./Dockerfile.ubuntu-2304) +- [`Dockerfile.ubuntu-2404`](./Dockerfile.ubuntu-2404) - [`Dockerfile.archlinux`](./Dockerfile.archlinux) ## Hints @@ -42,12 +42,13 @@ Examples: Distribution-specific default values: -| Distribution | `SOURCE_DATE_EPOCH` | `SNAPSHOT_ARCHIVE_BASE` | -|----------------|-------------------------------------------------------|--------------------------------------------------| -| Debian (<= 11) | Timestamp of `/etc/apt/sources.list` | `http://snapshot-cloudflare.debian.org/archive/` | -| Debian (>= 12) | Timestamp of `/etc/apt/sources.list.d/debian.sources` | `http://snapshot-cloudflare.debian.org/archive/` | -| Ubuntu | Timestamp of `/etc/apt/sources.list` | `http://snapshot.ubuntu.com/` | -| ArchLinux | Timestamp of `/var/log/pacman.log` | `http://archive.archlinux.org/` | +| Distribution | `SOURCE_DATE_EPOCH` | `SNAPSHOT_ARCHIVE_BASE` | +|-------------------|-------------------------------------------------------|--------------------------------------------------| +| Debian (<= 11) | Timestamp of `/etc/apt/sources.list` | `http://snapshot-cloudflare.debian.org/archive/` | +| Debian (>= 12) | Timestamp of `/etc/apt/sources.list.d/debian.sources` | `http://snapshot-cloudflare.debian.org/archive/` | +| Ubuntu (<= 23.10) | Timestamp of `/etc/apt/sources.list` | `http://snapshot.ubuntu.com/` | +| Ubuntu (>= 24.04) | Timestamp of `/etc/apt/sources.list.d/ubuntu.sources` | `http://snapshot.ubuntu.com/` | +| ArchLinux | Timestamp of `/var/log/pacman.log` | `http://archive.archlinux.org/` | ## Related project diff --git a/alternative/Dockerfile.debian-13 b/alternative/Dockerfile.debian-13 index 22bd3ca..0cc398f 100644 --- a/alternative/Dockerfile.debian-13 +++ b/alternative/Dockerfile.debian-13 @@ -7,7 +7,7 @@ RUN \ : "${SOURCE_DATE_EPOCH:=$(stat --format=%Y /etc/apt/sources.list.d/debian.sources)}" && \ snapshot="$(/bin/bash -euc "printf \"%(%Y%m%dT%H%M%SZ)T\n\" \"${SOURCE_DATE_EPOCH}\"")" && \ : "Enabling snapshot" && \ - sed -i -e '/URIs: http:\/\/deb.debian.org\/debian/ a\Snapshot: true' /etc/apt/sources.list.d/debian.sources && \ + sed -i -e '/Types: deb/ a\Snapshot: true' /etc/apt/sources.list.d/debian.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 && \ diff --git a/alternative/Dockerfile.ubuntu-2310 b/alternative/Dockerfile.ubuntu-2404 similarity index 86% rename from alternative/Dockerfile.ubuntu-2310 rename to alternative/Dockerfile.ubuntu-2404 index 6375dbe..7131cc1 100644 --- a/alternative/Dockerfile.ubuntu-2310 +++ b/alternative/Dockerfile.ubuntu-2404 @@ -1,13 +1,13 @@ # Base image must be Ubuntu 23.10 (Mantic Minotaur) or later: https://salsa.debian.org/apt-team/apt/-/merge_requests/291 -FROM ubuntu:mantic-20230819 +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)}" && \ + : "${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 's/^deb http/deb [snapshot=true] http/g' /etc/apt/sources.list && \ + 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 && \ diff --git a/repro-sources-list.sh b/repro-sources-list.sh index 29252b0..3256c36 100755 --- a/repro-sources-list.sh +++ b/repro-sources-list.sh @@ -24,7 +24,7 @@ # - debian:11 (/etc/apt/sources.list) # - debian:12 (/etc/apt/sources.list.d/debian.sources) # - ubuntu:22.04 (/etc/apt/sources.list) -# - ubuntu:23.10 (/etc/apt/sources.list) +# - ubuntu:24.04 (/etc/apt/sources.listd/ubuntu.sources) # - archlinux (/etc/pacman.d/mirrorlist) # # For the further information, see https://github.com/reproducible-containers/repro-sources-list.sh @@ -46,15 +46,12 @@ case "${ID}" in # : "${SNAPSHOT_ARCHIVE_BASE:=http://snapshot.debian.org/archive/}" : "${SNAPSHOT_ARCHIVE_BASE:=http://snapshot-cloudflare.debian.org/archive/}" : "${BACKPORTS:=}" - case "${VERSION_ID}" in - "10" | "11") - : "${SOURCE_DATE_EPOCH:=$(stat --format=%Y /etc/apt/sources.list)}" - ;; - *) + if [ -e /etc/apt/sources.list.d/debian.sources ]; then : "${SOURCE_DATE_EPOCH:=$(stat --format=%Y /etc/apt/sources.list.d/debian.sources)}" rm -f /etc/apt/sources.list.d/debian.sources - ;; - esac + else + : "${SOURCE_DATE_EPOCH:=$(stat --format=%Y /etc/apt/sources.list)}" + fi snapshot="$(printf "%(%Y%m%dT%H%M%SZ)T\n" "${SOURCE_DATE_EPOCH}")" # TODO: use the new format for Debian >= 12 echo "deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE}debian/${snapshot} ${VERSION_CODENAME} main" >/etc/apt/sources.list @@ -65,8 +62,14 @@ case "${ID}" in ;; "ubuntu") : "${SNAPSHOT_ARCHIVE_BASE:=http://snapshot.ubuntu.com/}" - : "${SOURCE_DATE_EPOCH:=$(stat --format=%Y /etc/apt/sources.list)}" + if [ -e /etc/apt/sources.list.d/ubuntu.sources ]; then + : "${SOURCE_DATE_EPOCH:=$(stat --format=%Y /etc/apt/sources.list.d/ubuntu.sources)}" + rm -f /etc/apt/sources.list.d/ubuntu.sources + else + : "${SOURCE_DATE_EPOCH:=$(stat --format=%Y /etc/apt/sources.list)}" + fi snapshot="$(printf "%(%Y%m%dT%H%M%SZ)T\n" "${SOURCE_DATE_EPOCH}")" + # TODO: use the new format for Ubuntu >= 24.04 echo "deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE}ubuntu/${snapshot} ${VERSION_CODENAME} main restricted" >/etc/apt/sources.list echo "deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE}ubuntu/${snapshot} ${VERSION_CODENAME}-updates main restricted" >>/etc/apt/sources.list echo "deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE}ubuntu/${snapshot} ${VERSION_CODENAME} universe" >>/etc/apt/sources.list