Skip to content

Commit 10de920

Browse files
authored
Merge pull request #5 from AkihiroSuda/dev
Add alternative/Dockerfile.debian-13
2 parents a237607 + ebf537c commit 10de920

File tree

5 files changed

+48
-1
lines changed

5 files changed

+48
-1
lines changed

.github/workflows/main.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ jobs:
4848
strategy:
4949
fail-fast: false
5050
matrix:
51-
dockerfile: ["Dockerfile.debian-11", "Dockerfile.debian-12", "Dockerfile.ubuntu-2204", "Dockerfile.ubuntu-2304"]
51+
dockerfile:
52+
- "Dockerfile.debian-11"
53+
- "Dockerfile.debian-12"
54+
- "Dockerfile.ubuntu-2204"
55+
- "Dockerfile.ubuntu-2304"
56+
- "alternative/Dockerfile.debian-13"
57+
- "alternative/Dockerfile.ubuntu-2310"
5258
steps:
5359
- uses: actions/checkout@v4
5460
- uses: docker/setup-buildx-action@v2

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ Examples:
1212
## Hint
1313
- To preserve the package cache on GHA, use <https://github.com/overmindtech/buildkit-cache-dance>.
1414
See [`.github/workflows/main.yaml`](./.github/workflows/main.yaml) for an example.
15+
16+
- For Debian >= 13 and Ubuntu >= 23.10, see also [`./alternative/`](./alternative/)
17+
to lock packages without using [`repro-sources-list.sh`](./repro-sources-list.sh).

alternative/Dockerfile.debian-13

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Base image must be Debian 13 (trixie) or later: https://salsa.debian.org/apt-team/apt/-/merge_requests/291
2+
FROM debian:trixie-20230904-slim
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
RUN \
5+
--mount=type=cache,target=/var/cache/apt,sharing=locked \
6+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
7+
: "${SOURCE_DATE_EPOCH:=$(stat --format=%Y /etc/apt/sources.list.d/debian.sources)}" && \
8+
snapshot="$(/bin/bash -euc "printf \"%(%Y%m%dT%H%M%SZ)T\n\" \"${SOURCE_DATE_EPOCH}\"")" && \
9+
: "Enabling snapshot" && \
10+
sed -i -e '/URIs: http:\/\/deb.debian.org\/debian/ a\Snapshot: true' /etc/apt/sources.list.d/debian.sources && \
11+
: "Enabling cache" && \
12+
rm -f /etc/apt/apt.conf.d/docker-clean && \
13+
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache && \
14+
: "Fetching the snapshot and installing ca-certificates in one command" && \
15+
apt-get install --update --snapshot "${snapshot}" -o Acquire::Check-Valid-Until=false -o Acquire::https::Verify-Peer=false -y ca-certificates && \
16+
: "Installing gcc" && \
17+
apt-get install --snapshot "${snapshot}" -y gcc

alternative/Dockerfile.ubuntu-2310

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Base image must be Ubuntu 23.10 (Mantic Minotaur) or later: https://salsa.debian.org/apt-team/apt/-/merge_requests/291
2+
FROM ubuntu:mantic-20230819
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
RUN \
5+
--mount=type=cache,target=/var/cache/apt,sharing=locked \
6+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
7+
: "${SOURCE_DATE_EPOCH:=$(stat --format=%Y /etc/apt/sources.list)}" && \
8+
snapshot="$(/bin/bash -euc "printf \"%(%Y%m%dT%H%M%SZ)T\n\" \"${SOURCE_DATE_EPOCH}\"")" && \
9+
: "Enabling snapshot" && \
10+
sed -i -e 's/^deb http/deb [snapshot=true] http/g' /etc/apt/sources.list && \
11+
: "Enabling cache" && \
12+
rm -f /etc/apt/apt.conf.d/docker-clean && \
13+
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache && \
14+
: "Fetching the snapshot and installing ca-certificates in one command" && \
15+
apt-get install --update --snapshot "${snapshot}" -o Acquire::Check-Valid-Until=false -o Acquire::https::Verify-Peer=false -y ca-certificates && \
16+
: "Installing gcc" && \
17+
apt-get install --snapshot "${snapshot}" -y gcc

alternative/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Alternative to `../repro-sources-list.sh`
2+
The following examples lock packages without using [`../repro-sources-list.sh`](../repro-sources-list.sh)
3+
- [`Dockerfile.debian-13`](./Dockerfile.debian-13)
4+
- [`Dockerfile.ubuntu-2310`](./Dockerfile.ubuntu-2310)

0 commit comments

Comments
 (0)