fix(image): act on the review of the image metadata
Label parser: split the LABEL instruction like a shell (a value may hold NAME=value text), read the last stage only, require base.name and tie it to the FROM tag, require the documentation link to be <source>/src/branch/main/docs/images/<name>.md and the page to be non-empty. Docs: do not name a Python version the base may not ship, show the lint.yml pin check as it is, say which workflow paths start a build, name the system-language local hooks, add the apparmor option and the registry path to the molecule usage, and soften unverified Renovate and host-release statements. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
c3c665e799
commit
aa1848a995
8 files changed
+142
-85
No files matched your search
@@ -29,7 +29,7 @@ driver:
|
||||
name: docker
|
||||
platforms:
|
||||
- name: instance
|
||||
image: ${MOLECULE_IMAGE_2604} # <name>:<version>@sha256:<digest>, set by .gitea/workflows/molecule.yml
|
||||
image: ${MOLECULE_IMAGE_2604} # git.rkdr.net/mortis/molecule-ubuntu2604:<version>@sha256:<digest>, set by molecule.yml
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
@@ -45,7 +45,9 @@ platforms:
|
||||
- apparmor=unconfined
|
||||
```
|
||||
|
||||
systemd needs a writable cgroup, the firewall tools need `NET_ADMIN`, and nothing runs privileged.
|
||||
systemd needs a writable cgroup (`cgroupns_mode: host`, the `/sys/fs/cgroup` mount and tmpfs on `/run`), the
|
||||
firewall tools need `NET_ADMIN`, AppArmor is left unconfined for the container (`apparmor=unconfined`), and
|
||||
nothing runs privileged. The docker driver needs molecule's docker plugin, which the runner provides.
|
||||
|
||||
The scenario `extensions/molecule/image-smoke-2604` tests this image against that contract (release,
|
||||
systemd, packages, the `dbus` and `ssh` units, the Python bindings, `NET_ADMIN`).
|
||||
@@ -57,21 +59,23 @@ systemd, packages, the `dbus` and `ssh` units, the Python bindings, `NET_ADMIN`)
|
||||
newest version and is for looking, not for pinning.
|
||||
- Pin `molecule-ubuntu2604:<version>@sha256:<digest>`; the digest is what is enforced. Consumers here:
|
||||
`.gitea/workflows/molecule.yml`.
|
||||
- Renovate moves the pin to a new version after the image is built on `main`.
|
||||
- Renovate is configured to move the pin to a new version after the image is built on `main` (the rule is in
|
||||
`renovate.json`; the first pin of a brand-new image is made by hand).
|
||||
|
||||
## How it is built and kept up to date
|
||||
|
||||
`.gitea/workflows/image.yml` builds it with kaniko on every push to `main` that changes its inputs
|
||||
(`images/molecule-ubuntu2604/`), never on a pull request. A change to the image needs a new `version:` in that
|
||||
workflow's matrix (Renovate's bump step does it for dependency updates). The base image
|
||||
and the Ubuntu release are fixed by the name: a new Ubuntu release is a new image
|
||||
(`molecule-ubuntuNNNN`), and the roles are tested on every release the hosts run or are moving to.
|
||||
`.gitea/workflows/image.yml` builds it with kaniko. The workflow runs on pushes to `main` that touch `images/**`,
|
||||
`requirements-dev.txt`, `.pre-commit-config.yaml` or the workflow itself, never on a pull request, and builds an
|
||||
image only when its `version:` in the workflow's matrix is not yet published. A change under
|
||||
`images/molecule-ubuntu2604/` therefore needs a new `version:` (Lint enforces it) and the merge builds the image. The
|
||||
Ubuntu release is fixed by the name: a new Ubuntu release is a new image (`molecule-ubuntuNNNN`), and the roles
|
||||
are tested on every release the hosts run or are moving to.
|
||||
|
||||
## Image metadata
|
||||
|
||||
The `org.opencontainers.image.*` labels (title, description, version, revision, created, source,
|
||||
documentation, licenses, authors) and `net.rkdr.mortis.*` labels (what it is for, what it contains,
|
||||
how to use it, the Ubuntu release) are listed on the package page of the registry; `version`,
|
||||
how to use it; the base image is `base.name`) are listed on the package page of the registry; `version`,
|
||||
`revision` and `created` are set by the build.
|
||||
|
||||
Source: [https://git.rkdr.net/mortis/kamino](https://git.rkdr.net/mortis/kamino), `images/molecule-ubuntu2604/Dockerfile`. Licence: GPL-3.0-or-later.
|
||||
Reference in new issue
Block a user