Skip to content

Commit

Permalink
docker: update to Debian 12 (Bookworm)
Browse files Browse the repository at this point in the history
Update parent image to bookworm.
This allows us to remove all the backports and also to build Ubuntu
images again as it requires dpkg zstd support.

Signed-off-by: Klaus Goger <[email protected]>
  • Loading branch information
kgoger authored and sjoerdsimons committed Nov 2, 2023
1 parent eab7759 commit 36cf333
Showing 1 changed file with 6 additions and 36 deletions.
42 changes: 6 additions & 36 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG GOPATH=/usr/local/go

### first stage - builder ###
FROM debian:bullseye-slim as builder
FROM debian:bookworm-slim as builder

ARG DEBIAN_FRONTEND
ARG GOPATH
Expand All @@ -26,24 +26,8 @@ COPY . $GOPATH/src/github.com/go-debos/debos
WORKDIR $GOPATH/src/github.com/go-debos/debos/cmd/debos
RUN go install ./...

# Pull the latest archlinux-keyring, since the one in Debian is outdated
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1026080
RUN apt-get update && \
apt-get install -y --no-install-recommends \
pkgconf \
python3-all \
sq \
systemd && \
rm -rf /var/lib/apt/lists/*

RUN git clone https://gitlab.archlinux.org/archlinux/archlinux-keyring && \
cd archlinux-keyring && \
git checkout -B latest-release 20221213 && \
make build && \
make PREFIX=/usr KEYRING_TARGET_DIR=/usr/share/keyrings/ DESTDIR=/arch-keyring install

### second stage - runner ###
FROM debian:bullseye-slim as runner
FROM debian:bookworm-slim as runner

ARG DEBIAN_FRONTEND
ARG GOPATH
Expand Down Expand Up @@ -96,26 +80,16 @@ RUN apt-get update && \
rsync \
systemd \
systemd-container \
systemd-resolved \
u-boot-tools \
unzip \
user-mode-linux \
xfsprogs \
xz-utils \
zip && \
rm -rf /var/lib/apt/lists/*

# Enable backports for the Arch dependencies
RUN echo "deb http://ftp.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list

# NOTE: Explicitly install arch-install-scripts from backports. The normal one
# lacks pactrap.
# Install Arch dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
zip \
makepkg \
pacman-package-manager && \
apt-get install -y --no-install-recommends \
-t bullseye-backports \
pacman-package-manager \
archlinux-keyring \
arch-install-scripts && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -127,8 +101,4 @@ RUN for arch in aarch64 alpha arm armeb cris hexagon hppa m68k microblaze mips m

COPY --from=builder $GOPATH/bin/debos /usr/local/bin/debos

# Pull the latest archlinux-keyring, since the one in Debian is outdated
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1026080
COPY --from=builder /arch-keyring/ /

ENTRYPOINT ["/usr/local/bin/debos"]

0 comments on commit 36cf333

Please sign in to comment.