Files
Kamino/images/molecule-ubuntu2604/Dockerfile
T
Defame1297andClaude Sonnet 5.5 69f29e2c28
Molecule / molecule (pull_request) Skipped
Build / build (pull_request) Successful in 9s
Lint / lint (pull_request) Successful in 11s
feat(image): add molecule-ubuntu2604, the target release next to 24.04
The hosts run Ubuntu 24.04 today and 26.04 is where they are going, so the roles are
tested on both. This adds only the image (Dockerfile, build matrix entry 0.1.0); the
scenario and the consumer pin follow in a second pull request, because the pin needs the
digest of the first build.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 18:49:02 +00:00

52 lines
2.6 KiB
Docker

# Molecule test target for the roles of this Collection: Ubuntu 26.04 with systemd
# as PID 1 and the packages the roles manage preinstalled, so a converge makes no
# network calls. It replaces the molecule test image that used to be built locally
# on the CI runner.
#
# Built by .gitea/workflows/image.yml with kaniko and pushed (never on pull
# requests) to git.rkdr.net/mortis/molecule-ubuntu2604. Consumers reference it
# by digest, never by tag:
#
# container:
# image: git.rkdr.net/mortis/molecule-ubuntu2604@sha256:<digest>
#
# or, in a molecule scenario: platforms[].image with pre_build_image: true. The
# scenario starts it with command /sbin/init, cgroupns_mode host, /sys/fs/cgroup
# mounted rw, tmpfs on /run and /run/lock, capability NET_ADMIN. No privileged mode.
#
# One RUN layer: about 30 MB compressed on top of the 29.8 MB base (estimated from
# the real .debs, with the .pyc files the postinst scripts compile), far below
# Cloudflare's 100 MB request-body limit on git.rkdr.net (kaniko pushes a layer as
# one request). apt packages are not version-pinned, as in the original image; the
# base image is pinned by digest and a rebuild is a reviewed digest bump downstream.
#
# The image carries SSH host keys and a machine-id generated at build time (the
# openssh-server and systemd postinst scripts). ssh.service runs `sshd -t` and
# fails without host keys, so they cannot be removed; image scanners will flag them.
# They are throwaway keys of a test target that is never exposed.
# ubuntu:26.04 index digest as of 2026-10-26.
FROM ubuntu:26.04@sha256:c098726dd9b9733f3e885f8de0ef375206a311b0a317eadc40d347b1115fb944
LABEL org.opencontainers.image.title="molecule-ubuntu2604" \
org.opencontainers.image.description="systemd-capable Ubuntu 26.04 molecule test target for mortis.kamino" \
org.opencontainers.image.source="https://git.rkdr.net/mortis/kamino" \
org.opencontainers.image.licenses="GPL-3.0-or-later"
ENV DEBIAN_FRONTEND=noninteractive
# systemd as PID 1 with D-Bus, sudo and networking tools; the Python Ansible needs on
# the target (python3-apt for the apt module); the firewall and intrusion-prevention
# packages the roles manage (python3-systemd is a dependency of fail2ban's systemd
# backend); sshd, enabled so a converge can test it under systemd.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
systemd systemd-sysv dbus sudo iproute2 ca-certificates \
python3 python3-apt python3-systemd \
iptables ufw fail2ban \
openssh-server \
&& rm -rf /var/lib/apt/lists/* \
&& systemctl enable ssh
STOPSIGNAL SIGRTMIN+3
CMD ["/sbin/init"]