Files
infrastructure/gdo/Dockerfile
T
blandClaude eab1f55cf7 gdo from the registry again: 0.4.0 is published
The stack built gdo from a commit while the gdo that dials a 1.0 site
was held back from the [uhhm] registry. It is there now, so the image
installs the package as before and the deploy no longer compiles gdo.
The build checks that the installed version is the one GDO_RELEASE
names.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5fbDjTQg4CJsNqEo7hhE7
2026-11-24 19:13:04 +01:00

47 lines
2.2 KiB
Docker

# gdo, the mailer, from the [uhhm] Arch registry - the same package the
# bare-metal hosts install. Arch base rather than Debian because that is
# how every uhhm binary is published; portal ships a release tarball and
# is built from that instead.
#
# GDO_RELEASE is the version the site runs (v0.4.0 or later: 0.4 is the
# first that dials a portal 1.0 site). The registry serves one version,
# its newest, so the build checks that what it installed is the one
# named, and fails when the variable has fallen behind the registry.
FROM archlinux:base
ARG GDO_RELEASE
# The registry's signing key, vendored beside this file. A fresh
# container trusts nothing, and the key is on no public keyserver, so
# `pacman-key --recv-keys` cannot find it - which is why this is here
# rather than fetched. It is a public key: checked in, not a secret.
#
# Vendored rather than turning the signature check off: the packages
# come over HTTPS from a host we run, and it would be easy to call that
# good enough, but then nothing would notice a package that host did
# not sign. Locally signed, the check stays real.
COPY uhhm-registry.asc /tmp/uhhm-registry.asc
RUN test -n "$GDO_RELEASE" \
&& pacman-key --init \
&& pacman-key --populate archlinux \
&& pacman-key --add /tmp/uhhm-registry.asc \
&& pacman-key --lsign-key 1BCBE90F04AD9859D7BCC9BB53CBF90AA4C56211 \
&& rm /tmp/uhhm-registry.asc \
&& printf '%s\n' \
'[uhhm]' \
'SigLevel = Required DatabaseOptional' \
'Server = https://project.uhhm.no/api/packages/bl/arch/$repo/$arch' \
>> /etc/pacman.conf \
&& pacman -Syu --noconfirm --needed ca-certificates gdo \
&& have=$(pacman -Q gdo | cut -d' ' -f2 | cut -d- -f1) \
&& { [ "$have" = "${GDO_RELEASE#v}" ] || { echo "the registry has gdo $have, GDO_RELEASE says $GDO_RELEASE" >&2; exit 1; }; } \
&& pacman -Scc --noconfirm \
&& rm -rf /var/cache/pacman/pkg/* /var/lib/pacman/sync/*
# A non-root user. gdo keeps its key on dhd/1 in /var/lib/gdo, a volume
# (GDO_KEY in compose.yml); what it has not yet delivered waits with the
# site, not here.
RUN useradd --system --no-create-home gdo \
&& mkdir -p /var/lib/gdo && chown gdo /var/lib/gdo && chmod 700 /var/lib/gdo
USER gdo
CMD ["/usr/bin/gdo"]