Skip to content

Pin every Dockerfile base image to a version#1044

Open
MDA2AV wants to merge 1 commit into
mainfrom
pin-dockerfile-base-images
Open

Pin every Dockerfile base image to a version#1044
MDA2AV wants to merge 1 commit into
mainfrom
pin-dockerfile-base-images

Conversation

@MDA2AV

@MDA2AV MDA2AV commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Closes #471.

24 FROM lines across 16 frameworks named a floating tag, so two runs months apart could measure different software with nothing in the results to show it.

Every pin resolves to what the floating tag pointed at

Checked against the registry before changing anything, so no build changes and no published result is invalidated:

was now verified
debian:stable-slim debian:trixie-slim 15× stable is Debian 13 today (VERSION_ID="13")
oven/bun:latest oven/bun:1.3 both report 1.3.14; one had no tag at all
dart:stable dart:3.12 both report 3.12.2
trueasync/…:latest-frankenphp …:0.8.4-php8.6-frankenphp identical digest sha256:567ccc5f…
buildpack-deps:curl buildpack-deps:bookworm-curl
gcr.io/distroless/base base-debian12@sha256:6273… distroless publishes no version tags, so digest

Deliberately left alone

debian:bookworm-slim, debian:trixie, buildpack-deps:bookworm and friends. A Debian codename is a release number — bookworm is 12, trixie is 13 — which is exactly the major.minor the issue asks for. Rewriting them would be churn without reproducibility gain.

It can't regress

validate.sh now rejects floating tags before spending a build on them, the same way it rejects unknown test names. It handles the cases that make this non-trivial:

  • a FROM naming an earlier build stage is not an image (this is why userver's FROM builder is not a finding)
  • build args (FROM $BASE), scratch, and @sha256: digest pins
  • a distro codename counts as a version

Verified both directions: all 132 Dockerfiles pass (0 unpinned), and against a synthetic file node:latest and a bare python are rejected while rust:1.83 AS build, FROM build and debian:trixie-slim are not.

Documented where it's needed

Under Add a Framework → Directory Structure, with good/rejected examples — a rule contributors need before opening a PR, not after a failed check.

🤖 Generated with Claude Code

Closes #471. 24 FROM lines across 16 frameworks named a floating tag, so two
runs months apart could measure different software with no way to tell from
the results.

Every pin here resolves to the image the floating tag pointed at when this was
written, checked against the registry first, so no build changes and no
published result is invalidated:

  debian:stable-slim  -> debian:trixie-slim    15x  stable is Debian 13 today
  oven/bun:latest     -> oven/bun:1.3           3x  both 1.3.14 (one had no tag)
  dart:stable         -> dart:3.12              2x  both 3.12.2
  trueasync…:latest-frankenphp
                      -> …:0.8.4-php8.6-frankenphp  2x  identical digest
  buildpack-deps:curl -> buildpack-deps:bookworm-curl  1x
  gcr.io/distroless/base
                      -> base-debian12@sha256:6273…   1x

distroless publishes no version tags at all, so that one is pinned by digest.

Left alone: debian:bookworm-slim, debian:trixie, buildpack-deps:bookworm and
similar. A Debian codename *is* a release number - bookworm is 12, trixie is
13 - which is the major.minor the issue asks for.

validate.sh now rejects floating tags before spending a build on them, the
same way it rejects unknown test names. It understands multi-stage builds
(a FROM naming an earlier stage is not an image), build args, scratch, digest
pins, and treats a distro codename as a version. Checked against all 132
Dockerfiles: 0 unpinned. Checked against a synthetic file: node:latest and a
bare python are both rejected, rust:1.83 and a stage reference are not.

Documented under Add a Framework, since this is a rule contributors need
before they open a PR rather than after.
@github-actions

Copy link
Copy Markdown
Contributor

👋 Heads up! This PR modifies the following frameworks:

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.

Use exact major version in dockerfiles

1 participant