Pin every Dockerfile base image to a version#1044
Open
MDA2AV wants to merge 1 commit into
Open
Conversation
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.
Contributor
|
👋 Heads up! This PR modifies the following frameworks:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #471.
24
FROMlines 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:
debian:stable-slimdebian:trixie-slimstableis Debian 13 today (VERSION_ID="13")oven/bun:latestoven/bun:1.31.3.14; one had no tag at alldart:stabledart:3.123.12.2trueasync/…:latest-frankenphp…:0.8.4-php8.6-frankenphpsha256:567ccc5f…buildpack-deps:curlbuildpack-deps:bookworm-curlgcr.io/distroless/basebase-debian12@sha256:6273…Deliberately left alone
debian:bookworm-slim,debian:trixie,buildpack-deps:bookwormand 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.shnow 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:FROMnaming an earlier build stage is not an image (this is whyuserver'sFROM builderis not a finding)FROM $BASE),scratch, and@sha256:digest pinsVerified both directions: all 132 Dockerfiles pass (0 unpinned), and against a synthetic file
node:latestand a barepythonare rejected whilerust:1.83 AS build,FROM buildanddebian:trixie-slimare 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