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.

Lesson 23 of 26 · 9 min read · practice only with authorization

Diagram

One tag, two images

Follow the path. One example at a time.

Step 1 of 4

Monday

api:1.4 resolves to one digest.

Illustration: Monday
$ 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.

  1. 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.
  2. 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.
  3. 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.

1 / 3

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.

Practice

  1. LabTerminal mission: Three hosts, one tag, three imagesThree hosts pull payments-gw:latest and each runs something different. Compare digests with the signed release list and the registry push log to find the image nobody released.

Glossary

  1. CardMutable image tagsThe tag latest moves, so today's deploy is not what you tested.