Skip to content

ADR-045: The Runtime Image Is Built From Wolfi Packages

Status: Accepted (supersedes ADR-009).

Context: The image ran on gcr.io/distroless/python3-debian13:nonroot (ADR-009). Most of what a scanner reported on it came from that base, and most users scan without applying a VEX document, so the base was the only thing that changed what they saw. Issue #1379 measured compose-lint 1.10.0 on nine bases with four scanners, on linux/amd64 and linux/arm64, with no VEX applied. Distinct vulnerability IDs:

Base Grype 0.122.1 Trivy 0.77.0 OSV-Scanner 2.7.1 Docker Scout 1.30.0
Distroless Debian (published 1.10.0), Python 3.13 103 104 105 31
Wolfi packages, python-3.13 12 0 26 (13 CVEs) 0
Wolfi packages, python-3.15 7 0 16 (8 CVEs) 0

The other bases, and why each was not chosen, are on the issue.

Decision: The runtime image has no base image. Its final stage is FROM scratch, and what it holds is Wolfi packages installed into an empty root, with Python 3.15. No shell, no package manager and no busybox are in it. It runs as UID 65532.

  • Alpine's apk is the installer. A stage on a digest-pinned alpine image reads the Wolfi repository with the signing key committed at docker/wolfi-signing.rsa.pub and installs with --no-scripts into two directories: the runtime root, and a build root that also has busybox, CA certificates and pip. No image from Wolfi's publisher is used.
  • Versions come from two lock files. docker/wolfi-runtime.lock and docker/wolfi-build.lock name every package with its version, including what the chosen packages pull in. The Dockerfile's lock target resolves the newest versions and scripts/wolfi-lock.sh copies the result out.
  • The build stage is the build root. The venv is built by the interpreter that ships, so it moves between stages unchanged, as it did under ADR-009.
  • The runtime root keeps what the previous base gave a user: a nonroot account for UID 65532 with a home directory, and LANG and HOME set. It has no timezone data. compose-lint reads none.

Why Wolfi packages:

  • Lowest counts measured, with no critical or high finding from Grype, Trivy or Scout.
  • Scanners read the image. The package database and /etc/os-release stay in it. Grype, Trivy and Scout each listed all 30 packages at their installed versions, and OSV-Scanner listed them under source package names. A control image built the same way from old builds of Python, Expat and SQLite drew 85, 38, 80 and 32 findings from the four, so the low counts are advisory matching and not unread packages. Trivy and Scout reported nothing for the old SQLite where Grype reported 14; that gap is not explained.
  • The Python line is a choice. The repository carries python-3.13, python-3.14 and python-3.15 side by side.

Why Python 3.15 and not 3.13: the 3.13 build carried five Python findings the 3.15 build did not. Four had fixes merged on CPython's 3.14 and 3.15 branches with the 3.13 backports still open; the fifth was fixed before 3.15.0. The Wolfi packages are snapshots of each branch, so they ship what has been merged there. 3.15 is in the test matrix. Leaving 3.13 is also what ends the debian:13-slim build stage: Debian 13 has Python 3.13 only, and both stages need the same interpreter.

What ADR-009 objected to, and what became of it:

  • A shell, apk and busybox at runtime. Solved: packages are installed into an empty root from another stage.
  • Renovate cannot track apk versions. Still true. The lock files are outside Renovate. wolfi-lock-refresh.yml moves them instead: a daily pull request takes each package to its newest build at least 72 hours old and merges itself when the Docker smokes pass. scripts/wolfi-lock.sh takes the newest builds by hand when a fix cannot wait (docs/CI.md).
  • A pinned version becomes unbuildable once it leaves the repository. Still true, and accepted. An old release cannot be rebuilt from its lock once a pinned build is gone. Published images are not affected. When the base was chosen the repository still held python-3.13 builds 481 days old.

Costs:

  • The project owns the image build, where it used to own two FROM lines.
  • What stays in the Wolfi repository is its publisher's decision. If the Python line in use were withdrawn, the image would move to another line or to Alpine packages, which were measured as the fallback (Grype 21, Trivy 0, OSV-Scanner 0, Scout 2).
  • A lock pins a version, not a content hash. apk verifies the repository index against the committed key and each package against the index, so the trust is in that key, as it was in the registry for a digest.
  • The image moves from Python 3.13 to 3.15 in one release.

The OpenVEX document: it carried 56 statements for CVEs in the Debian base, each checked against that base by tests/smoke/assert_vex_claims.py. They named no package and no version (ADR-012), so they would have gone on applying to an image they were never checked against. They are removed with the base, along with that script and the three Debian glibc entries in .vex/open-findings.json. The six pip statements stay: they are about the venv, not the base, and tests/smoke/assert_pip_stripped.py still checks them in every image built. Releases up to 1.10.1 keep the document that was attested to them. The six pip statements and the rest of the document were removed after 1.11.0 (ADR-046), and the open-findings list moved to docker/open-findings.json.

Licensing: the Wolfi build recipes are Apache 2.0 and each package is under its upstream licence (Wolfi's licence file). The image is the combination; its SBOM lists the parts. compose-lint stays MIT.