diff --git a/.gitea/workflows/image.yml b/.gitea/workflows/image.yml index 7a3346c..5183beb 100644 --- a/.gitea/workflows/image.yml +++ b/.gitea/workflows/image.yml @@ -2,7 +2,7 @@ name: Images # Builds the images under images/ with kaniko (osscontainertools fork, v1.28.6) and # pushes them to git.rkdr.net/mortis/ (ADR 0004, Image distribution): the molecule -# test target (molecule-ubuntu2404) and the lint/build tooling (ci). +# test targets (molecule-ubuntu2404, molecule-ubuntu2604) and the lint/build tooling (ci). # # Never on pull_request: a workflow file comes from the PR head, so a fork PR could # otherwise push to the registry. This workflow has no pull_request trigger, and the job @@ -74,6 +74,10 @@ jobs: version: 0.1.2 subpath: images/molecule-ubuntu2404 dockerfile: Dockerfile + - name: molecule-ubuntu2604 + version: 0.1.0 + subpath: images/molecule-ubuntu2604 + dockerfile: Dockerfile - name: ci version: 0.2.4 subpath: "" diff --git a/CLAUDE.md b/CLAUDE.md index 36a7094..28de7c5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -45,8 +45,12 @@ protection, or create tags: those are the operator's. ## Images (`images/`) -- `ci` and `molecule-ubuntu2404`, built by `image.yml` with kaniko on push to `main` (never on +- `ci`, `molecule-ubuntu2404` and `molecule-ubuntu2604`, built by `image.yml` with kaniko on push to `main` (never on pull requests) and pushed to `git.rkdr.net/mortis/`. +- The molecule images are one Ubuntu release each, by name: the hosts run 24.04 today and 26.04 is the + target, so roles are tested on both. A new release is a new image added by hand (Renovate's major `ubuntu` + updates are disabled for their Dockerfiles); retire an image when no host runs its release. A new image's + first consumer pin is a hand-made PR with the digest its first build printed; Renovate follows it after. - Each has a semver `version:` in the workflow's build matrix. A published version tag is never moved and never rebuilt (the job looks it up in the registry first and ends without building): bump the version in the PR that changes the image. A new version is pushed as `` and diff --git a/images/molecule-ubuntu2604/Dockerfile b/images/molecule-ubuntu2604/Dockerfile new file mode 100644 index 0000000..93ac595 --- /dev/null +++ b/images/molecule-ubuntu2604/Dockerfile @@ -0,0 +1,51 @@ +# 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: +# +# 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"] diff --git a/renovate.json b/renovate.json index e59febe..155cedc 100644 --- a/renovate.json +++ b/renovate.json @@ -99,9 +99,10 @@ "enabled": false }, { - "description": "molecule-ubuntu2404 is Ubuntu 24.04 by name and by contract (extensions/molecule/image-smoke asserts it, and the roles are tested against it): a new Ubuntu release is a new image, not a base bump. Tag and digest updates within 24.04 still arrive.", + "description": "The molecule-ubuntu images are one Ubuntu release by name and by contract (extensions/molecule/image-smoke* assert it, and the roles are tested against it): a new Ubuntu release is a new image, not a base bump. Tag and digest updates within a release still arrive.", "matchFileNames": [ - "images/molecule-ubuntu2404/Dockerfile" + "images/molecule-ubuntu2404/Dockerfile", + "images/molecule-ubuntu2604/Dockerfile" ], "matchPackageNames": [ "ubuntu"