Mutable image tags: why latest is not a version
Container tags like latest or 1.4 can point at different images over time, so two deploys of the same tag can run different code. How to pin digests, enable tag immutability, and keep updates reviewable.
Diagram
One tag, two images
Step 1 of 4
Monday
api:1.4 resolves to one digest.
$ docker buildx imagetools inspect registry.example.test/api:1.4 | grep Digest Digest: sha256:4b9f...e21c
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
latest in production
- What fails
- latest means whatever was pushed last.
- Who is affected
- Every service using it.
- What you would notice
- image: something:latest in manifests.
- What you change
- Use version tags plus digests.
Base image drift
- What fails
- FROM lines by tag pull new bases silently.
- Who is affected
- Reproducibility and audits.
- What you would notice
- Builds that differ with no code change.
- What you change
- Pin base digests and update with a bot.
Registry settings
- What fails
- Registries allow tag overwrite by default.
- Who is affected
- Consumers of the tag.
- What you would notice
- Tag mutability enabled.
- What you change
- Turn on immutability for release repositories.
Keeping pins fresh
Pinning without updates leaves you on old bases. Renovate and Dependabot can update digests in Dockerfiles and manifests through pull requests, which keeps changes visible and reviewable.
Check yourself
Recognition and the fix. Nothing here is a procedure.
Two nodes run different code for the same api:1.4 tag. Why?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.
This page stands on its own. The lab and the glossary card are the next reading.