From 251f928b08bc4350ab5f2e7b33f4f60c8c77331d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 18 Sep 2026 17:34:05 +0000 Subject: [PATCH 1/3] Stop shipping the 4 GB package repository in every image, and check signatures Mapping the published image's layers to its config history showed what the "3 GB GNOME layer" was: layer 34 4064 MiB COPY --from=packages /repository /etc/utah-packages layer 41 979 MiB the actual package transaction total 5.94 GiB 45 layers, no chunkah annotations of Utah's own The Containerfile copied the package factory's entire RPM repository into the image so dnf could install from file:///etc/utah-packages, and nothing ever removed it: two thirds of every pull, 4 GB under /etc on every installed system, and the largest single contributor to the 7.9 GB ISO, whose squashfs holds the image (#130, #128). The repository is now bind mounted into the two RUN steps that install from it -- the main transaction and the flavor step that builds the OGC kernel and NVIDIA module -- and never committed to a layer. The pinned `packages` stage is still the only source the transaction can see, which is what the old COPY comment meant by reproducible. The flavor step, the last one that installs anything, flips utah-packages.repo to enabled=0 so later dnf calls on the image (the live ISO build's included) do not fail on a baseurl that is not there. just check now refuses a COPY --from=packages. Hummingbird's RPMs are signed with Red Hat's release key 2 (RSA/SHA256, key ID 199e2f91fd431d51, verified against a downloaded package), but packages/hummingbird.repo carried gpgcheck=0 copied from upstream's lockfile-tooling repo file, so the build logged Warning: skipped OpenPGP checks for 702 packages The key is committed (fingerprint 567E 347A D004 4ADE 55BA 8A5F 199E 2F91 FD43 1D51), installed under /etc/pki/rpm-gpg in both Containerfiles, and the repo file runs with gpgcheck=1. The factory repository stays at gpgcheck=0: its trust root is the pinned image's OCI provenance, as its file says. Changing hummingbird.repo rotates the kernel-cache tag, so the first gaming build after this compiles the kernel once. The live ISO's dracut run failed on every build, dracut-install: ERROR: installing '/root' to '/root' dracut[E]: FAILED: ... dracut-install -D ... -f /root /root because /root is a symlink to /var/roothome and the target does not exist at build time, and dracut still exited 0 so the build went on with a module silently dropped (#132). The target now exists for the duration of the run, the run is under pipefail, and a dracut[E] FAILED line fails the step. configure-services.sh no longer claims Utah is rechunked; it is not, because reusable-build skips chunkah on the testing stream (#131), which needs a change in projectbluefin/actions. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M --- Containerfile | 23 +++++++++++----- Containerfile.kernel | 2 ++ Justfile | 4 ++- docs/skills/containerfile.md | 8 ++++++ iso/live/Containerfile | 17 ++++++++++-- packages/RPM-GPG-KEY-redhat-release-2 | 33 +++++++++++++++++++++++ packages/hummingbird.repo | 9 ++++++- packages/utah-packages.repo | 4 +++ scripts/configure-services.sh | 5 ++-- tests/test_package_resolution.py | 39 +++++++++++++++++++++++++++ 10 files changed, 131 insertions(+), 13 deletions(-) create mode 100644 packages/RPM-GPG-KEY-redhat-release-2 diff --git a/Containerfile b/Containerfile index a7c4b7f9..28b319b7 100644 --- a/Containerfile +++ b/Containerfile @@ -41,10 +41,16 @@ FROM ${BASE_IMAGE} # turn below them. COPY packages/bluefin.toml packages/utah.toml contracts/bluefin-desktop.toml /usr/share/utah/ COPY packages/hummingbird.repo packages/nvidia-container.repo packages/utah-packages.repo /etc/yum.repos.d/ -# The package image is an RPM repository, not a runtime dependency. Its -# contents are intentionally copied into the image so the package transaction -# is reproducible and does not depend on a mutable Pages mirror. -COPY --from=packages /repository /etc/utah-packages +# Hummingbird signs its RPMs with Red Hat's release key 2 (fd431d51); the key +# lets packages/hummingbird.repo run with gpgcheck=1 here and in the live ISO +# build on top of this image. +COPY packages/RPM-GPG-KEY-redhat-release-2 /etc/pki/rpm-gpg/ +# The package image is an RPM repository, not a runtime dependency. It is bind +# mounted into the two RUN steps that install from it and never copied: a COPY +# used to put the whole 4 GB repository at /etc/utah-packages, nothing removed +# it, and it was two thirds of every published image and of every ISO (#130). +# Reproducibility comes from the digest-pinned `packages` stage, which is +# still the only source the transaction can see. # One layer for all of Utah's scripts. They are staged under /tmp and installed # by name in the RUN below, because a multi-source COPY cannot rename and # every downstream path expects the utah- prefix. @@ -112,7 +118,8 @@ RUN for pair in install-packages.py:utah-install-packages \ # The package lists live in the manifests, not here. When they were spelled # out in this RUN as well, the two copies drifted and the contract check was # asserting a different set than the install had asked for. -RUN /usr/local/libexec/utah-install-packages \ +RUN --mount=type=bind,from=packages,source=/repository,target=/etc/utah-packages,ro \ + /usr/local/libexec/utah-install-packages \ /usr/share/utah/bluefin.toml /usr/share/utah/utah.toml && \ IMAGE_FLAVOR=main /usr/local/libexec/utah-verify-rpm-contract \ /usr/share/utah/bluefin.toml /usr/share/utah/utah.toml && \ @@ -180,7 +187,8 @@ RUN mkdir -p /tmp/uupd && \ # Dakota-compatible flavors: OGC is built and asserted before NVIDIA so the # NVIDIA path can bind its module to the exact kernel tree it will boot. -RUN case "${IMAGE_FLAVOR}" in \ +RUN --mount=type=bind,from=packages,source=/repository,target=/etc/utah-packages,ro \ + case "${IMAGE_FLAVOR}" in \ gaming|nvidia-gaming) /usr/local/libexec/utah-install-ogc-kernel ;; \ main|nvidia) ;; \ *) echo "Unknown Utah image flavor: ${IMAGE_FLAVOR}" >&2; exit 2 ;; \ @@ -190,7 +198,8 @@ RUN case "${IMAGE_FLAVOR}" in \ main|gaming) ;; \ esac && \ IMAGE_FLAVOR="${IMAGE_FLAVOR}" /usr/local/libexec/utah-verify-rpm-contract \ - /usr/share/utah/bluefin.toml /usr/share/utah/utah.toml + /usr/share/utah/bluefin.toml /usr/share/utah/utah.toml && \ + sed -i 's/^enabled=1$/enabled=0/' /etc/yum.repos.d/utah-packages.repo # Everything above writes build-time residue that bootc lint rejects: dnf logs # under /var/log, cockpit and dnf state under /run, and ~45 /var directories diff --git a/Containerfile.kernel b/Containerfile.kernel index 94f51404..bf8e2325 100644 --- a/Containerfile.kernel +++ b/Containerfile.kernel @@ -24,6 +24,8 @@ FROM ${BASE_IMAGE} AS builder # itself installs from: Hummingbird's overlay plus the pinned Fedora 44 # buildroot. Fedora is builder-only; it is not copied into the runtime stage. COPY packages/hummingbird.repo /etc/yum.repos.d/hummingbird.repo +# hummingbird.repo runs with gpgcheck=1; the key it names has to exist here too. +COPY packages/RPM-GPG-KEY-redhat-release-2 /etc/pki/rpm-gpg/ COPY packages/fedora-44.repo /etc/yum.repos.d/fedora-44.repo RUN mkdir -p /usr/local/libexec COPY scripts/install-ogc-kernel.sh /usr/local/libexec/utah-install-ogc-kernel diff --git a/Justfile b/Justfile index 28eda936..ca35e77e 100644 --- a/Justfile +++ b/Justfile @@ -64,7 +64,9 @@ check: grep -q 'ENABLE_SSHD="${ENABLE_SSHD:-0}"' Justfile grep -q 'ARG PACKAGE_IMAGE_SHA=' Containerfile grep -q 'ARG PACKAGE_IMAGE_REF=' Containerfile - grep -q 'COPY --from=packages /repository /etc/utah-packages' Containerfile + grep -q '--mount=type=bind,from=packages,source=/repository,target=/etc/utah-packages,ro' Containerfile + ! grep -q 'COPY --from=packages' Containerfile + test -f packages/RPM-GPG-KEY-redhat-release-2 # Every executable release asset fetched during composition must be pinned # and verified; no build may resolve a mutable latest release. python3 scripts/check-download-integrity.py diff --git a/docs/skills/containerfile.md b/docs/skills/containerfile.md index 696ce1d9..f19a64ff 100644 --- a/docs/skills/containerfile.md +++ b/docs/skills/containerfile.md @@ -39,6 +39,14 @@ In summary: layer uses it or not: with `VERSION` at the top, the package transaction missed the registry layer cache on every commit, since `VERSION` carries the date and the commit. Nothing above the branding step ever sees them. +- The package repository is bind mounted, never copied: + `RUN --mount=type=bind,from=packages,source=/repository,target=/etc/utah-packages,ro` + on the two steps that install from it. A `COPY --from=packages` used to put + the whole 4 GB repository into the image, nothing removed it, and it was two + thirds of every published image and of every ISO (#130). `just check` + refuses a `COPY --from=packages`. `packages/utah-packages.repo` is committed + with `enabled=0` for the same reason: the path exists only during those two + steps, and they enable the repo explicitly. - `ARG PACKAGE_IMAGE_REF=${PACKAGE_IMAGE}@${PACKAGE_IMAGE_SHA}` defaults to the digest-pinned OCI package repository for reproducible CI builds, while allowing local composition to inject a local image from containers-storage diff --git a/iso/live/Containerfile b/iso/live/Containerfile index de7d3989..50e36d74 100644 --- a/iso/live/Containerfile +++ b/iso/live/Containerfile @@ -50,10 +50,23 @@ RUN chmod 0755 /tmp/utah-live-src/configure-live.sh && \ # to open; the installed system boots the payload image's own initramfs, which # this build never touches. Revisit if Utah ever wants TPM-bound LUKS, which # needs tpm2-tools in the installed image, not in the live overlay. -RUN set -eux; \ +# /root is a symlink to /var/roothome in a bootc image and the target does not +# exist at build time, so dracut's install of /root failed on every build: +# dracut-install: ERROR: installing '/root' to '/root' +# dracut[E]: FAILED: /usr/lib/dracut/dracut-install ... -f /root /root +# and dracut still exited 0, so the failure never stopped the build (#132). +# Give the symlink a target for the duration of the build, and treat any +# dracut[E] FAILED line as the error it is. +RUN set -euxo pipefail; \ + mkdir -p /var/roothome; \ kernel="$(ls /usr/lib/modules | sort -V | tail -1)"; \ dracut --force --reproducible --no-hostonly \ --add dmsquash-live \ --omit 'tpm2-tss pcsc' \ --add-drivers 'squashfs overlay loop iso9660 sr_mod cdrom' \ - "/usr/lib/modules/${kernel}/initramfs.img" "${kernel}" + "/usr/lib/modules/${kernel}/initramfs.img" "${kernel}" 2>&1 | tee /tmp/dracut.log; \ + if grep -q 'dracut\[E\]: FAILED' /tmp/dracut.log; then \ + echo 'dracut reported a failed install; refusing to ship the initramfs' >&2; exit 1; \ + fi; \ + rm -f /tmp/dracut.log; \ + rmdir /var/roothome || true diff --git a/packages/RPM-GPG-KEY-redhat-release-2 b/packages/RPM-GPG-KEY-redhat-release-2 new file mode 100644 index 00000000..2d596a06 --- /dev/null +++ b/packages/RPM-GPG-KEY-redhat-release-2 @@ -0,0 +1,33 @@ +pub 4096R/FD431D51 2009-10-22 + Key fingerprint = 567E 347A D004 4ADE 55BA 8A5F 199E 2F91 FD43 1D51 +uid Red Hat, Inc. (release key 2) + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.22 (GNU/Linux) + +mQINBErgSTsBEACh2A4b0O9t+vzC9VrVtL1AKvUWi9OPCjkvR7Xd8DtJxeeMZ5eF +0HtzIG58qDRybwUe89FZprB1ffuUKzdE+HcL3FbNWSSOXVjZIersdXyH3NvnLLLF +0DNRB2ix3bXG9Rh/RXpFsNxDp2CEMdUvbYCzE79K1EnUTVh1L0Of023FtPSZXX0c +u7Pb5DI5lX5YeoXO6RoodrIGYJsVBQWnrWw4xNTconUfNPk0EGZtEnzvH2zyPoJh +XGF+Ncu9XwbalnYde10OCvSWAZ5zTCpoLMTvQjWpbCdWXJzCm6G+/hx9upke546H +5IjtYm4dTIVTnc3wvDiODgBKRzOl9rEOCIgOuGtDxRxcQkjrC+xvg5Vkqn7vBUyW +9pHedOU+PoF3DGOM+dqv+eNKBvh9YF9ugFAQBkcG7viZgvGEMGGUpzNgN7XnS1gj +/DPo9mZESOYnKceve2tIC87p2hqjrxOHuI7fkZYeNIcAoa83rBltFXaBDYhWAKS1 +PcXS1/7JzP0ky7d0L6Xbu/If5kqWQpKwUInXtySRkuraVfuK3Bpa+X1XecWi24JY +HVtlNX025xx1ewVzGNCTlWn1skQN2OOoQTV4C8/qFpTW6DTWYurd4+fE0OJFJZQF +buhfXYwmRlVOgN5i77NTIJZJQfYFj38c/Iv5vZBPokO6mffrOTv3MHWVgQARAQAB +tDNSZWQgSGF0LCBJbmMuIChyZWxlYXNlIGtleSAyKSA8c2VjdXJpdHlAcmVkaGF0 +LmNvbT6JAjYEEwEIACACGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAUCSuBJPAAK +CRAZni+R/UMdUfIkD/9m3HWv07uJG26R3KBexTo2FFu3rmZs+m2nfW8R3dBX+k0o +AOFpgJCsNgKwU81LOPrkMN19G0+Yn/ZTCDD7cIQ7dhYuDyEX97xh4une/EhnnRuh +ASzR+1xYbj/HcYZIL9kbslgpebMn+AhxbUTQF/mziug3hLidR9Bzvygq0Q09E11c +OZL4BU6J2HqxL+9m2F+tnLdfhL7MsAq9nbmWAOpkbGefc5SXBSq0sWfwoes3X3yD +Q8B5Xqr9AxABU7oUB+wRqvY69ZCxi/BhuuJCUxY89ZmwXfkVxeHl1tYfROUwOnJO +GYSbI/o41KBK4DkIiDcT7QqvqvCyudnxZdBjL2QU6OrIJvWmKs319qSF9m3mXRSt +ZzWtB89Pj5LZ6cdtuHvW9GO4qSoBLmAfB313pGkbgi1DE6tqCLHlA0yQ8zv99OWV +cMDGmS7tVTZqfX1xQJ0N3bNORQNtikJC3G+zBCJzIeZleeDlMDQcww00yWU1oE7/ +To2UmykMGc7o9iggFWR2g0PIcKsA/SXdRKWPqCHG2uKHBvdRTQGupdXQ1sbV+AHw +ycyA/9H/mp/NUSNM2cqnBDcZ6GhlHt59zWtEveiuU5fpTbp4GVcFXbW8jStj8j8z +1HI3cywZO8+YNPzqyx0JWsidXGkfzkPHyS4jTG84lfu2JG8m/nqLnRSeKpl20Q== +=79bX +-----END PGP PUBLIC KEY BLOCK----- diff --git a/packages/hummingbird.repo b/packages/hummingbird.repo index 8d930675..ac23d5f3 100644 --- a/packages/hummingbird.repo +++ b/packages/hummingbird.repo @@ -6,6 +6,13 @@ name=public-hummingbird-x86_64-rpms baseurl=https://packages.redhat.com/api/pulp-content/public-hummingbird/x86_64/ enabled=1 sslverify=1 -gpgcheck=0 +# Hummingbird's own repo file ships gpgcheck=0 so that their lockfile tooling +# fails loudly instead of silently on a bad signature. Their RPMs are signed +# (RSA/SHA256, key ID 199e2f91fd431d51, Red Hat release key 2), so an image +# build has no reason to skip the check. The key is committed as +# packages/RPM-GPG-KEY-redhat-release-2 (fingerprint 567E 347A D004 4ADE 55BA +# 8A5F 199E 2F91 FD43 1D51) and installed by the Containerfile. +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release-2 priority=10 zchunk=false diff --git a/packages/utah-packages.repo b/packages/utah-packages.repo index 793d0169..72362b9f 100644 --- a/packages/utah-packages.repo +++ b/packages/utah-packages.repo @@ -4,6 +4,10 @@ [utah-packages] name=Utah package factory baseurl=file:///etc/utah-packages +# The path exists only while the Containerfile bind mounts the pinned package +# image there. The flavor step, the last one that installs anything, flips this +# to enabled=0 so later dnf calls on the image (the live ISO build included) +# do not fail on a baseurl that is not there. enabled=1 gpgcheck=0 repo_gpgcheck=0 diff --git a/scripts/configure-services.sh b/scripts/configure-services.sh index 1eb2fb71..457ece1c 100644 --- a/scripts/configure-services.sh +++ b/scripts/configure-services.sh @@ -37,9 +37,10 @@ disable_unit() { # Hummingbird intentionally does not ship every Bluefin integration package. # Not enabled: rechunker-group-fix.service. It exists to repair the # /usr/lib/{group,gshadow} damage left by the legacy rechunker -# (hhd-dev/rechunk) when rebasing to an image built without it. Utah rechunks -# with chunkah, through projectbluefin/actions' reusable-build, and has never +# (hhd-dev/rechunk) when rebasing to an image built without it. Utah has never # been through legacy-rechunk -- so there is nothing here for it to repair. +# (Utah is not rechunked at all today: reusable-build skips chunkah on the +# testing stream, which is the only stream Utah builds. Tracked by #131.) # # It is not merely useless, it breaks the boot. The unit orders itself both # After=local-fs.target and Before=systemd-sysusers.service, and local-fs diff --git a/tests/test_package_resolution.py b/tests/test_package_resolution.py index 4f6c27fe..2064906c 100644 --- a/tests/test_package_resolution.py +++ b/tests/test_package_resolution.py @@ -160,5 +160,44 @@ def test_verifier_asserts_the_parity_section(self): self.assertIn("*parity,", source) +class ImageSizeTests(unittest.TestCase): + MOUNT = "--mount=type=bind,from=packages,source=/repository,target=/etc/utah-packages,ro" + + def test_package_repository_is_mounted_not_copied(self): + # #130: a COPY put the whole 4 GB repository into every image and ISO. + source = (ROOT / "Containerfile").read_text() + self.assertNotIn("COPY --from=packages", source) + steps = [step for step in source.split("\nRUN ") if step.startswith(self.MOUNT)] + self.assertEqual(len(steps), 2, "both install steps must mount the repository") + self.assertIn("utah-install-packages", steps[0]) + self.assertIn("utah-install-ogc-kernel", steps[1]) + self.assertIn("utah-install-nvidia", steps[1]) + # Nothing installs after the flavor step, so it is the one that turns + # the repository file off for the image's lifetime. + self.assertIn("sed -i 's/^enabled=1$/enabled=0/' /etc/yum.repos.d/utah-packages.repo", steps[1]) + + def test_package_repository_file_is_enabled_only_during_the_build(self): + text = (ROOT / "packages/utah-packages.repo").read_text() + self.assertIn("enabled=1", text) + self.assertIn("baseurl=file:///etc/utah-packages", text) + self.assertIn("utah-packages", installer.REPOS) + + def test_hummingbird_packages_are_signature_checked(self): + text = (ROOT / "packages/hummingbird.repo").read_text() + self.assertIn("gpgcheck=1", text) + self.assertIn("gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release-2", text) + key = (ROOT / "packages/RPM-GPG-KEY-redhat-release-2").read_text() + self.assertIn("BEGIN PGP PUBLIC KEY BLOCK", key) + for containerfile in ("Containerfile", "Containerfile.kernel"): + self.assertIn("COPY packages/RPM-GPG-KEY-redhat-release-2 /etc/pki/rpm-gpg/", + (ROOT / containerfile).read_text(), containerfile) + + def test_live_initramfs_build_fails_on_a_dracut_error(self): + source = (ROOT / "iso/live/Containerfile").read_text() + self.assertIn("mkdir -p /var/roothome", source) + self.assertIn("set -euxo pipefail", source) + self.assertIn("dracut\\[E\\]: FAILED", source) + + if __name__ == "__main__": unittest.main() From 04ab0d7aa46b109530535e4f14be829ab29ad31b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 18 Sep 2026 17:37:05 +0000 Subject: [PATCH 2/3] Justfile: pass the --mount pattern to grep with -e, it was parsed as an option CI's contract job failed on the previous commit with grep: unrecognized option '--mount=type=bind,...' because the pattern starts with two dashes. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Justfile b/Justfile index ca35e77e..4a6e2eb6 100644 --- a/Justfile +++ b/Justfile @@ -64,7 +64,7 @@ check: grep -q 'ENABLE_SSHD="${ENABLE_SSHD:-0}"' Justfile grep -q 'ARG PACKAGE_IMAGE_SHA=' Containerfile grep -q 'ARG PACKAGE_IMAGE_REF=' Containerfile - grep -q '--mount=type=bind,from=packages,source=/repository,target=/etc/utah-packages,ro' Containerfile + grep -q -e '--mount=type=bind,from=packages,source=/repository,target=/etc/utah-packages,ro' Containerfile ! grep -q 'COPY --from=packages' Containerfile test -f packages/RPM-GPG-KEY-redhat-release-2 # Every executable release asset fetched during composition must be pinned From 9ad11ba91e22f5a9c104d03d9c5fd214210b1bd8 Mon Sep 17 00:00:00 2001 From: hanthor Date: Sat, 19 Sep 2026 11:16:55 +0000 Subject: [PATCH 3/3] Make the check guards fail, and correct what the doc claims about the repo file The review on #133 is right on both counts. `! grep -q 'COPY --from=packages' Containerfile` enforced nothing. errexit exempts any pipeline beginning with `!`, so a failing one neither stops the script nor changes its exit status: $ bash -c 'set -euo pipefail; ! grep -q RUN Containerfile; echo reached' reached $ echo $? 0 So the PR body claimed a gate the recipe did not have; only the unit test enforced it. Both `!` guards in `check` are now explicit `if ... exit 1` blocks with a message that says what to do. The workflow-literal guard on the following line had been working by accident: it was the last command in the recipe, so its status was the recipe's status. That is a property of where it sits in the file, not of what it does, and any line appended after it silently switches it off. Worth knowing for #144, which appends exactly such a line. The containerfile skill also described a design this repository does not have. It said utah-packages.repo is committed with enabled=0 and that the two mounted steps enable it explicitly. It is committed with enabled=1 -- the repo file's own comment says why -- and the flavor step flips it to 0 afterwards so later dnf calls on the finished image do not fail on a baseurl that is no longer mounted. The doc now says that. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M --- Justfile | 13 +++++++++++-- docs/skills/containerfile.md | 6 ++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Justfile b/Justfile index 4a6e2eb6..f36a2f82 100644 --- a/Justfile +++ b/Justfile @@ -65,7 +65,13 @@ check: grep -q 'ARG PACKAGE_IMAGE_SHA=' Containerfile grep -q 'ARG PACKAGE_IMAGE_REF=' Containerfile grep -q -e '--mount=type=bind,from=packages,source=/repository,target=/etc/utah-packages,ro' Containerfile - ! grep -q 'COPY --from=packages' Containerfile + # `! cmd` is exempt from errexit, so a bare `! grep` neither stops this + # script nor changes its status unless it happens to be the last line: the + # guard reads as a gate and enforces nothing. Use an explicit exit. + if grep -q 'COPY --from=packages' Containerfile; then + echo 'Containerfile must bind-mount the package repository, not COPY it' >&2 + exit 1 + fi test -f packages/RPM-GPG-KEY-redhat-release-2 # Every executable release asset fetched during composition must be pinned # and verified; no build may resolve a mutable latest release. @@ -91,7 +97,10 @@ check: # No workflow may carry its own copy of the flavor list. That drift is what # config/flavors.json exists to stop: narrowing the build matrix while # promote and release still name images nothing produces fails late. - ! grep -rn 'utah-nvidia\|utah-gaming' .github/workflows/ + if grep -rn 'utah-nvidia\|utah-gaming' .github/workflows/; then + echo 'no workflow may name a flavored image; read it from config/flavors.json' >&2 + exit 1 + fi # Verify branding, desktop defaults, first-boot Flatpak policy, and service # enablement in an already-composed image. The same verifier runs in the diff --git a/docs/skills/containerfile.md b/docs/skills/containerfile.md index f19a64ff..f9b50c0c 100644 --- a/docs/skills/containerfile.md +++ b/docs/skills/containerfile.md @@ -45,8 +45,10 @@ In summary: the whole 4 GB repository into the image, nothing removed it, and it was two thirds of every published image and of every ISO (#130). `just check` refuses a `COPY --from=packages`. `packages/utah-packages.repo` is committed - with `enabled=0` for the same reason: the path exists only during those two - steps, and they enable the repo explicitly. + with `enabled=1`, because the two mounted steps install from it; the flavor + step, the last one that installs anything, flips it to `enabled=0` so a later + dnf call on the finished image -- the live ISO build among them -- does not + fail on a baseurl that is no longer mounted (comment, the repo file itself). - `ARG PACKAGE_IMAGE_REF=${PACKAGE_IMAGE}@${PACKAGE_IMAGE_SHA}` defaults to the digest-pinned OCI package repository for reproducible CI builds, while allowing local composition to inject a local image from containers-storage