Files
container-base/Dockerfile
T
unkin-agent 970cfad2ee Add matrixed container base image build
Replace the packer-images almalinux base with a Dockerfile matrix over distros/,
publishing one image per distro to docker-internal on a single repo semver.

- bootstrap the internal CA from a sha256-pinned rpm fetched over plain HTTP
- install the estate dnf repo configuration pointed at artifactapi
- run in-image assertions as a --target test build stage
- add pull_request build/test/pre-commit and tag-triggered docker workflows
2026-09-27 17:47:22 +10:00

29 lines
867 B
Docker

# syntax=docker/dockerfile:1
ARG BASE_IMAGE=docker.io/almalinux:9
FROM ${BASE_IMAGE} AS image
ARG DISTRO=alma9
COPY distros/${DISTRO}/ /tmp/distro/
RUN set -eux; \
. /tmp/distro/distro.env; \
rm -f /etc/yum.repos.d/*.repo; \
curl -fsSL -o /tmp/ca.rpm "$CA_RPM_URL"; \
echo "$CA_RPM_SHA256 /tmp/ca.rpm" | sha256sum -c -; \
rpm -i /tmp/ca.rpm; \
cp /tmp/distro/yum.repos.d/*.repo /etc/yum.repos.d/; \
dnf makecache; \
dnf update -y; \
dnf install -y $PACKAGES; \
dnf clean all; \
rm -rf /var/cache/dnf /tmp/ca.rpm /tmp/distro
CMD ["/bin/bash"]
# Built only via `--target test`; assertions run as a build step so a broken image
# fails the build, with no docker daemon needed in CI.
FROM image AS test
ARG DISTRO=alma9
COPY distros/${DISTRO}/distro.env test.sh /tmp/test/
RUN cd /tmp/test && ./test.sh
FROM image AS final