| 1 |
# docker run --cap-add SYS_ADMIN --cap-drop SETFCAP --tmpfs /tmp:dev,exec,suid,noatime ... |
| 2 |
|
| 3 |
# bootstrapping a new architecture? |
| 4 |
# ./scripts/debuerreotype-init /tmp/docker-rootfs trixie now |
| 5 |
# ./scripts/debuerreotype-minimizing-config /tmp/docker-rootfs |
| 6 |
# ./scripts/debuerreotype-debian-sources-list /tmp/docker-rootfs trixie |
| 7 |
# ./scripts/debuerreotype-tar /tmp/docker-rootfs - | docker import - debian:trixie-slim |
| 8 |
# alternate: |
| 9 |
# debootstrap --variant=minbase trixie /tmp/docker-rootfs |
| 10 |
# tar -cC /tmp/docker-rootfs . | docker import - debian:trixie-slim |
| 11 |
# (or your own favorite set of "debootstrap" commands to create a base image for building this one FROM) |
| 12 |
FROM debian:trixie-slim |
| 13 |
|
| 14 |
RUN set -eux; \ |
| 15 |
apt-get update; \ |
| 16 |
apt-get install -y --no-install-recommends \ |
| 17 |
debian-ports-archive-keyring \ |
| 18 |
debootstrap \ |
| 19 |
wget ca-certificates \ |
| 20 |
xz-utils \ |
| 21 |
\ |
| 22 |
gnupg dirmngr \ |
| 23 |
# add "gpgv" explicitly (for now) since it's transitively-essential in bookworm and gone in trixie+ |
| 24 |
gpgv \ |
| 25 |
; \ |
| 26 |
rm -rf /var/lib/apt/lists/* |
| 27 |
|
| 28 |
# fight the tyrrany of HSTS (which destroys our ability to transparently cache snapshot.debian.org responses) |
| 29 |
ENV WGETRC /.wgetrc |
| 30 |
RUN echo 'hsts=0' >> "$WGETRC" |
| 31 |
|
| 32 |
# https://github.com/debuerreotype/debuerreotype/issues/100 |
| 33 |
# https://tracker.debian.org/pkg/distro-info-data |
| 34 |
# http://snapshot.debian.org/package/distro-info-data/ |
| 35 |
# http://snapshot.debian.org/package/distro-info-data/0.66/ |
| 36 |
RUN set -eux; \ |
| 37 |
wget -O distro-info-data.deb 'http://snapshot.debian.org/archive/debian/20250721T022532Z/pool/main/d/distro-info-data/distro-info-data_0.66_all.deb'; \ |
| 38 |
echo '2d083730bd927b1ccb452d93d5d01f31e69d8682 *distro-info-data.deb' | sha1sum --strict --check -; \ |
| 39 |
apt-get install -y ./distro-info-data.deb; \ |
| 40 |
rm distro-info-data.deb; \ |
| 41 |
[ -s /usr/share/distro-info/debian.csv ] |
| 42 |
|
| 43 |
RUN set -eux; \ |
| 44 |
apt-get update; \ |
| 45 |
apt-get install -y --no-install-recommends patch; \ |
| 46 |
rm -rf /var/lib/apt/lists/*; \ |
| 47 |
\ |
| 48 |
# https://bugs.debian.org/973852 |
| 49 |
# https://salsa.debian.org/installer-team/debootstrap/-/merge_requests/63 |
| 50 |
# https://people.debian.org/~tianon/debootstrap-mr-63--download_main.patch |
| 51 |
wget -O debootstrap-download-main.patch 'https://people.debian.org/~tianon/debootstrap-mr-63--download_main.patch'; \ |
| 52 |
echo 'ceae8f508a9b49236fa4519a44a584e6c774aa0e4446eb1551f3b69874a4cde5 *debootstrap-download-main.patch' | sha256sum --strict --check -; \ |
| 53 |
patch --input=debootstrap-download-main.patch /usr/share/debootstrap/functions; \ |
| 54 |
rm debootstrap-download-main.patch |
| 55 |
|
| 56 |
# this env is a defined interface used by other scripts |
| 57 |
ENV DEBUERREOTYPE_DIRECTORY /opt/debuerreotype |
| 58 |
|
| 59 |
# see ".dockerignore" |
| 60 |
COPY . $DEBUERREOTYPE_DIRECTORY |
| 61 |
RUN set -eux; \ |
| 62 |
cd "$DEBUERREOTYPE_DIRECTORY/scripts"; \ |
| 63 |
for f in debuerreotype-*; do \ |
| 64 |
ln -svL "$PWD/$f" "/usr/local/bin/$f"; \ |
| 65 |
done; \ |
| 66 |
version="$(debuerreotype-version)"; \ |
| 67 |
[ "$version" != 'unknown' ]; \ |
| 68 |
echo "debuerreotype version $version" |
| 69 |
|
| 70 |
WORKDIR /tmp |
| 71 |
|
| 72 |
|
| 73 |
# a few example sha256sum values for amd64: |
| 74 |
|
| 75 |
# debuerreotype-init --keyring /usr/share/keyrings/debian-archive-removed-keys.pgp --no-merged-usr test-stretch stretch 2017-05-08T00:00:00Z |
| 76 |
# debuerreotype-tar test-stretch test-stretch.tar |
| 77 |
# sha256sum test-stretch.tar |
| 78 |
# 7b295f07692e13e3aaec0709e38f5fbfe3b7153d024c556430be70fd845fc174 |
| 79 |
# ./docker-run.sh sh -euxc 'debuerreotype-init --keyring /usr/share/keyrings/debian-archive-removed-keys.pgp --no-merged-usr /tmp/rootfs stretch 2017-05-08T00:00:00Z; debuerreotype-tar /tmp/rootfs - | sha256sum' |
| 80 |
|
| 81 |
# debuerreotype-init --keyring /usr/share/keyrings/debian-archive-removed-keys.pgp --no-merged-usr test-jessie jessie 2017-05-08T00:00:00Z |
| 82 |
# debuerreotype-tar test-jessie test-jessie.tar |
| 83 |
# sha256sum test-jessie.tar |
| 84 |
# 5d1daeb8e817a56d28b65b4fa5eb09ebb1963299a0ccfd2a37c07560779653cd |
| 85 |
# ./docker-run.sh sh -euxc 'debuerreotype-init --keyring /usr/share/keyrings/debian-archive-removed-keys.pgp --no-merged-usr /tmp/rootfs jessie 2017-05-08T00:00:00Z; debuerreotype-tar /tmp/rootfs - | sha256sum' |