fix(images): build when Ubuntu upgrades a base package

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
This commit is contained in:
Defame1297 committed 2026-12-03 08:30:16 +00:00
1 parent e446e1e09a
commit 9127ac565a
8 files changed
+51 -41

No files matched your search

+4 -3
View File
@@ -37,15 +37,16 @@
# Layers: each COPY / RUN below is one layer, and a layer is pushed as one request,
# so it must stay below Cloudflare's 100 MB request-body limit on git.rkdr.net. The
# build stage prints the sizes it will copy; the first push is the real test.
# Base image: ubuntu:26.04 index digest as of 2026-10-26, same as molecule-ubuntu2604.
# Base image: ubuntu:26.04 index digest as of 2026-12-03, same as molecule-ubuntu2604.
FROM ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db AS os
FROM ubuntu:26.04@sha256:a8417def3fc37c2d8cf513fe69ef871d415a45a27847779fae461c5047710edd AS os
ENV DEBIAN_FRONTEND=noninteractive
# No python3-pip: tools are installed with the venv's own pip. python3-venv brings
# ensurepip. apt lists are removed in the same layer.
# ensurepip. The upgrade brings in updates newer than the base image. apt lists are removed in the same layer.
RUN apt-get update \
&& apt-get upgrade -y --with-new-pkgs --no-install-recommends \
&& apt-get install -y --no-install-recommends \
ca-certificates git python3 python3-venv shellcheck \
&& rm -rf /var/lib/apt/lists/*