Skip to content

Commit

Permalink
Merge pull request #15 from AkihiroSuda/dev
Browse files Browse the repository at this point in the history
Support Ubuntu 24.04
  • Loading branch information
AkihiroSuda authored Apr 24, 2024
2 parents 3748a0d + 4ea49ce commit a0a47b4
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ubuntu-2304 → Dockerfile.ubuntu-2404
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion alternative/Dockerfile.debian-13
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
Original file line number Diff line number Diff line change
@@ -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 && \
Expand Down
21 changes: 12 additions & 9 deletions repro-sources-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a0a47b4

Please sign in to comment.