fix(images): build when Ubuntu has upgraded a base package #509

Open
Claude wants to merge 2 commits from fix/images-base-upgrade into main
pull from: fix/images-base-upgrade
Owner

What and why

Refs #508. The issue stays open until the Images run on main has published all four images.

The Images workflow installs its tools in the job container before the build. When Ubuntu has a newer openssl than the base image, that install upgrades libssl3t64, the clean-base check fails, and no image is built. The newest base images still hold the older openssl, so moving to them does not fix it.

  • Setup step: it no longer compares package versions. It still fails on a package added or removed compared with the base image, and on a new file under /usr, /lib, /bin, /sbin, /opt or /etc that no package owns.
  • Kaniko runs with --pre-cleanup: it empties the job container's filesystem before it unpacks the base image, so an upgraded package in the job container cannot leave stale files or be missing from the layers.
  • Credential: the build step now also empties the registry credential file when it exits, because a build that fails right after the cleanup leaves no rm for the last step.
  • Newest packages: each Dockerfile runs apt-get upgrade in its existing apt layer, so an image has Ubuntu's newest package versions when it is built.
  • Base images: both digests move to the ones published on 2026-12-03.

Verified

  • 333 unit tests, pre-commit run --all-files and scripts/check_image_versions.py pins pass.
  • Both digests match what Docker Hub serves for 24.04 and 26.04.
  • The kaniko v1.28.6 source was read for the flag, the unpack and the snapshot order. The unpack comes before the first snapshot, so the Dockerfile's own upgrade lands in a layer.
  • The leftover check and the credential trap were run in bash with stand-in input.
  • A clean-context review found no blocking issues.

Not verified

  • No image build has run with this change. image.yml runs only on main, so the run after the merge is the first real test. If it fails in the kaniko step after "Deleting filesystem...", remove the --pre-cleanup line; for anything else, revert. Published tags are never moved, so the current pins keep working.

  • A future Ubuntu update that adds a new dependency to a base package would still fail the setup step, because the purge removes that dependency and the base package with it.

  • A new Ubuntu package alone does not trigger a build. An image is rebuilt only when its inputs change. A scheduled rebuild is not part of this change.

  • Files I added carry SPDX headers, or are covered by REUSE.toml (REUSE-clean); no third-party NOTICE is needed.

Assisted-by: Claude Code

## What and why Refs #508. The issue stays open until the Images run on `main` has published all four images. The Images workflow installs its tools in the job container before the build. When Ubuntu has a newer openssl than the base image, that install upgrades `libssl3t64`, the clean-base check fails, and no image is built. The newest base images still hold the older openssl, so moving to them does not fix it. - **Setup step:** it no longer compares package versions. It still fails on a package added or removed compared with the base image, and on a new file under /usr, /lib, /bin, /sbin, /opt or /etc that no package owns. - **Kaniko runs with `--pre-cleanup`:** it empties the job container's filesystem before it unpacks the base image, so an upgraded package in the job container cannot leave stale files or be missing from the layers. - **Credential:** the build step now also empties the registry credential file when it exits, because a build that fails right after the cleanup leaves no `rm` for the last step. - **Newest packages:** each Dockerfile runs `apt-get upgrade` in its existing apt layer, so an image has Ubuntu's newest package versions when it is built. - **Base images:** both digests move to the ones published on 2026-12-03. ## Verified - 333 unit tests, `pre-commit run --all-files` and `scripts/check_image_versions.py pins` pass. - Both digests match what Docker Hub serves for `24.04` and `26.04`. - The kaniko v1.28.6 source was read for the flag, the unpack and the snapshot order. The unpack comes before the first snapshot, so the Dockerfile's own upgrade lands in a layer. - The leftover check and the credential trap were run in bash with stand-in input. - A clean-context review found no blocking issues. ## Not verified - **No image build has run with this change.** `image.yml` runs only on `main`, so the run after the merge is the first real test. If it fails in the kaniko step after "Deleting filesystem...", remove the `--pre-cleanup` line; for anything else, revert. Published tags are never moved, so the current pins keep working. - **A future Ubuntu update that adds a new dependency to a base package** would still fail the setup step, because the purge removes that dependency and the base package with it. - **A new Ubuntu package alone does not trigger a build.** An image is rebuilt only when its inputs change. A scheduled rebuild is not part of this change. - [x] Files I added carry SPDX headers, or are covered by `REUSE.toml` (REUSE-clean); no third-party NOTICE is needed. Assisted-by: Claude Code
Claude added this to the CI velocity (emergency) milestone 2026-12-03 08:39:08 +00:00
Claude added 2 commits 2026-12-03 08:39:08 +00:00
Installing the job container's tools upgrades base packages once Ubuntu
has newer ones, and the purge does not downgrade them, so the version
check failed every image. Kaniko now empties the root filesystem and
unpacks the base image before its first snapshot (--pre-cleanup), so the
versions no longer matter. Extra packages and files no package owns
still fail the job.

With the filesystem emptied, a failed build can leave no rm for the last
step, so the build step empties the credential file itself.

The images also kept the base image's package versions. Each Dockerfile
now upgrades them, and the base digests move to the newest published.

Refs #508

Assisted-by: Claude Code
docs(images): name the leftover check in the setup step comment
Build / build (pull_request) Successful in 22s
Molecule / select (pull_request) Successful in 2s
Molecule / scenarios (pull_request) Skipped
Molecule / Result (pull_request) Successful in 0s
Lint / lint (pull_request) Successful in 2m14s
508ed5ce12
The check compares package names and unowned files now, not a pristine
filesystem.

Assisted-by: Claude Code
CODEOWNERS rules requested review from Defame1297 2026-12-03 08:39:08 +00:00
All checks were successful
Build / build (pull_request) Successful in 22s
Required
Details
Molecule / select (pull_request) Successful in 2s
Molecule / scenarios (pull_request) Skipped
Molecule / Result (pull_request) Successful in 0s
Required
Details
Lint / lint (pull_request) Successful in 2m14s
Required
Details
This pull request has official review requests.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/images-base-upgrade:fix/images-base-upgrade
git checkout fix/images-base-upgrade
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#509