Skip to content

Commit

Permalink
docker: Use prebuild archlinux keyring
Browse files Browse the repository at this point in the history
Currently rebuilding the arch keyring on Debian bookworm is broken as
the build depends  on newer sq options. There is no reason to re-build
the keyring though, debian also uses a pre-build version to package it
for example.

Switch to use a script to download the latest release from arch gitlab

Signed-off-by: Sjoerd Simons <[email protected]>
  • Loading branch information
sjoerdsimons committed Feb 26, 2024
1 parent f21bdfd commit 4f198a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
19 changes: 4 additions & 15 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ENV GOPATH=${GOPATH}
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
git \
golang-go \
Expand All @@ -29,20 +30,8 @@ RUN go install ./...
# Install the latest archlinux-keyring, since the one in Debian is bound
# to get outdated sooner or later.
# WARNING: returning to the debian package will break the pacstrap action
RUN apt-get update && \
apt-get install -y --no-install-recommends \
pkgconf \
python3-all \
sq \
systemd \
make && \
rm -rf /var/lib/apt/lists/*

RUN git clone https://gitlab.archlinux.org/archlinux/archlinux-keyring && \
cd archlinux-keyring && \
git checkout master && \
make build && \
make PREFIX=/usr KEYRING_TARGET_DIR=/usr/share/keyrings/ DESTDIR=/arch-keyring install
COPY docker/get-archlinux-keyring.sh /
RUN /get-archlinux-keyring.sh /arch-keyring

### second stage - runner ###
FROM debian:bookworm-slim as runner
Expand Down Expand Up @@ -122,6 +111,6 @@ COPY --from=builder $GOPATH/bin/debos /usr/local/bin/debos
# Install the latest archlinux-keyring, since the one in Debian is bound
# to get outdated sooner or later.
# WARNING: returning to the debian package will break the pacstrap action
COPY --from=builder /arch-keyring/usr/share/keyrings /usr/share/keyrings
COPY --from=builder /arch-keyring /usr/share/keyrings

ENTRYPOINT ["/usr/local/bin/debos"]
13 changes: 13 additions & 0 deletions docker/get-archlinux-keyring.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
LINK=https://gitlab.archlinux.org/archlinux/archlinux-keyring/-/releases/permalink/latest
TARGET="${1:-.}"

RELEASE=$(curl -I -o /dev/null -v -w '%header{location}\n' \
${LINK} \
| sed 's/.*\///')

echo Arch keyring release ${RELEASE}
echo Installing to ${TARGET}
mkdir -p ${TARGET}
curl -s -L ${LINK}/downloads/archlinux-keyring-${RELEASE}.tar.gz \
| tar xvz --strip-components=1 -C ${TARGET}

0 comments on commit 4f198a5

Please sign in to comment.