ci(images): add git to the molecule-controller image
Build / build (pull_request) Successful in 39s
Molecule / molecule (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 2m3s

The Molecule select job runs the selector in this image, and the
selector diffs the checkout with git.

Closes #488

Assisted-by: Claude Code
This commit is contained in:
Defame1297 committed 2026-12-01 22:42:23 +00:00
1 parent 2ad2fe6060
commit 75f9d27329
2 files changed
+7 -5

No files matched your search

+5 -3
View File
@@ -29,9 +29,10 @@ FROM ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da0
ENV DEBIAN_FRONTEND=noninteractive
# python3 and python3-venv only bootstrap uv in the build stage; ca-certificates serve the
# install a job runs when a pull request changes a pin. apt lists are removed in the same layer.
# install a job runs when a pull request changes a pin; git lets the selector diff the checkout.
# apt lists are removed in the same layer.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates python3 python3-venv \
&& apt-get install -y --no-install-recommends ca-certificates git python3 python3-venv \
&& rm -rf /var/lib/apt/lists/*
@@ -92,7 +93,7 @@ LABEL org.opencontainers.image.title="molecule-controller" \
org.opencontainers.image.authors="Defame1297 and contributors" \
org.opencontainers.image.base.name="ubuntu:26.04" \
net.rkdr.mortis.purpose="Molecule controller image for the mortis.kamino Ansible Collection: the Molecule workflow runs molecule in it, so a tool only Lint uses does not change it." \
net.rkdr.mortis.contents="Ubuntu 26.04, /opt/venv (ansible-core, molecule, molecule-plugins[docker]), /opt/collections (community.general, ansible.posix, community.proxmox, community.docker), python<PYTHON_VERSION> (the one of /opt/venv), python3 (distribution), /opt/molecule-pins.sha256" \
net.rkdr.mortis.contents="Ubuntu 26.04, /opt/venv (ansible-core, molecule, molecule-plugins[docker]), /opt/collections (community.general, ansible.posix, community.proxmox, community.docker), python<PYTHON_VERSION> (the one of /opt/venv), python3 and git (distribution), /opt/molecule-pins.sha256" \
net.rkdr.mortis.usage="Molecule (host executor, kamino-molecule runner): docker run as the runner user, with the Docker socket, the host Docker CLI and the checkout mounted at the same path. Run sha256sum -c /opt/molecule-pins.sha256 in the checkout root and install the pinned tools and collections when a pull request changed them, else use /opt/venv/bin and ANSIBLE_COLLECTIONS_PATH=/opt/collections. See the documentation label."
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
@@ -122,6 +123,7 @@ RUN set -eu; \
molecule --version | grep -F "molecule ${mol}"; \
molecule drivers | grep -qw docker; \
python -c "import docker"; \
git --version; \
collections="$(ansible-galaxy collection list --format json)"; \
for c in $(sed -n 's/^ *- name: *//p' requirements.yml extensions/molecule/requirements.yml); do \
printf '%s' "$collections" | python -c "import json, sys; d = json.load(sys.stdin); sys.exit(0 if any('$c' in v for v in d.values()) else 1)" \