Skip to content

build: pin base images by digest and upgrade base packages at build time - #295

Merged
krisztianfekete merged 1 commit into
mainfrom
ci/pin-base-image-digests
Nov 24, 2026
Merged

krisztianfekete merged 1 commit into
mainfrom
ci/pin-base-image-digests

Conversation

@krisztianfekete

Copy link
Copy Markdown
Member

What and why

Pins the three base images in the Dockerfile by digest and runs apk upgrade before installing packages.

The docker CI job failed on #292 and #293 while Wolfi's apk server returned errors for a few minutes; a rerun passed unchanged. The build was exposed because wolfi-base:latest and node:26-bookworm-slim change digest often (wolfi moved twice in about 21 hours). Each move invalidates the apk layer, so every build downloaded packages again, and PR builds got almost no use from the cache main writes.

Changes:

  • uv, node and wolfi-base are pinned to their multi-arch index digests, so the layer cache stays valid until a digest is bumped deliberately.
  • The image names in FROM are now written out in full. Dependabot does not expand ARGs in FROM lines and skipped both wolfi-base and uv without an error; its last docker run found only node. With literal references it can update all three digests.
  • apk upgrade runs in the same layer as apk add. Release builds run without a cache, so released images still get current glibc, openssl and other base package fixes even if the pinned digest is a few days old.

Breaking: the BASE_IMAGE_REGISTRY and UV_VERSION build args are removed. Nothing in this repo sets them, but a build passing --build-arg BASE_IMAGE_REGISTRY=<mirror> now pulls from cgr.dev without warning.

After merge, the next Dependabot docker run should list wolfi-base and uv in its dependency snapshot.

How it was tested

  • docker build --build-arg VERSION=0.0.0.dev0 . on arm64 succeeds, and the log shows all three stages resolving the pinned digests. CI covers amd64.
  • Ran the CI smoke checks on the image: /api/health returns status: ok with version 0.0.0.dev0, / serves the UI root, and the container runs as uid 1000. Python is 3.14.10 and uv is 0.12.11.
  • apk version -l '<' in the final image reports no pending upgrades.
  • uv run pytest: 2164 passed, 19 skipped.

Checklist

  • Links an issue a maintainer agreed to (or is a typo or broken link fix)
  • Tests added or updated
  • All tests pass (uv run pytest)
  • Documentation updated (if applicable)
  • I understand every line of this change and can explain it in review

AI assistance

  • No significant AI assistance
  • AI helped write the code

@krisztianfekete
krisztianfekete merged commit fd7174e into main Nov 24, 2026
9 checks passed
@krisztianfekete
krisztianfekete deleted the ci/pin-base-image-digests branch November 24, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant