Registries, tags and image provenance
Registries store images by digest and tags point at them. Why tags move, how to pin a digest, and how SBOMs, provenance and signatures vouch for an image.
Images, layers and writing a DockerfileBuild once, promote through environments
Registries, tags and image provenance
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- A registry stores manifests and layers by the SHA-256 of their bytes. A digest names exactly one piece of content and can never point at anything else.
- A tag is a movable pointer to a digest. latest, 1 and 1.31 can all point at the same image today and at different ones tomorrow.
- A multi-architecture tag points at an index that lists one image per platform, and those images are not guaranteed to be the same version.
- Deploy by digest, or by a tag your registry makes immutable, so what you tested is exactly what runs.
- An SBOM lists what is inside an image and provenance records how it was built. A signature, such as one from Sigstore's cosign, is what lets you trust either.
Same name, different image
Staging ran notes-api:latest on Tuesday and everything passed. Production pulled notes-api:latest on Thursday and broke. Nobody deployed anything new to production. Somebody pushed a new image to the registry on Wednesday, and latest quietly moved.
Build once, promote through environments says the thing you tested must be the thing you ship. A container registry can give you that guarantee, or quietly break it, depending on how you refer to images.
What a registry stores
A registry is two things. A content-addressed store: every layer, config and manifest is stored under the SHA-256 of its bytes, its digest. And a table of tags, human names that point at a digest. The difference is the whole lesson. A digest can only ever mean one set of bytes. A tag is a sticky note you can peel off and put somewhere else.
The registry API is plain HTTP. I asked Docker Hub for the nginx:latest manifest with curl and an anonymous token, saved the body, and hashed it myself:
$ curl -sI -H "Authorization: Bearer $TOKEN" -H "Accept: application/vnd.oci.image.index.v1+json" \
https://registry-1.docker.io/v2/library/nginx/manifests/latest | grep -iE '^(content-type|docker-content-digest|ratelimit-limit)'
content-type: application/vnd.oci.image.index.v1+json
docker-content-digest: sha256:6a3df739b6312289e87d70947d900669c1b3087474ece5814b9c01bbf2e6dde3
ratelimit-limit: 100;w=3600
$ shasum -a 256 index.json
6a3df739b6312289e87d70947d900669c1b3087474ece5814b9c01bbf2e6dde3 index.json
The digest is just the hash of the document, so any client can check it got what it asked for. The rate-limit header is a side lesson: anonymous pulls from Docker Hub are limited to 100 per hour per address, which is one reason teams run their own registry or a pull-through cache.
Tags move, and not always together
I resolved seven nginx tags to digests with HEAD requests, one after another:
latest sha256:6a3df739b6312289e87d70947d900669c1b3087474ece5814b9c01bbf2e6dde3
mainline sha256:6a3df739b6312289e87d70947d900669c1b3087474ece5814b9c01bbf2e6dde3
1.31 sha256:6a3df739b6312289e87d70947d900669c1b3087474ece5814b9c01bbf2e6dde3
1.31.10 sha256:a786635fd3c7b9a57ea089ab1c0713e510f3b548b65fe699ce3d59e4a926b37e
1.31.10-trixie sha256:a786635fd3c7b9a57ea089ab1c0713e510f3b548b65fe699ce3d59e4a926b37e
stable sha256:755983e0e0e568e4c86297cc91485d7a6f9fb73e42d8a19cdba3eac9e8b8cfc9
1 sha256:6a3df739b6312289e87d70947d900669c1b3087474ece5814b9c01bbf2e6dde3
Four names, one image. When 1.31.11 ships, latest, 1 and 1.31 will move and 1.31.10 will stay. That is the normal case.
The surprise is that 1.31.10 has a different digest from latest, even though latest’s image says NGINX_VERSION=1.31.10. Both digests name an index, a list of one image per CPU architecture. Its amd64 entry was the same image in both. When I diffed the two indexes, latest had one extra entry, for riscv64, annotated org.opencontainers.image.version: 1.31.9. The RISC-V build lagged a release behind, so it is in latest but not in 1.31.10. A tag can resolve to different versions on different hardware, and the name does not tell you.
The fix is to deploy by digest:
image: nginx@sha256:6a3df739b6312289e87d70947d900669c1b3087474ece5814b9c01bbf2e6dde3
Readable tags are still useful for people. Many teams tag with the Git commit and turn on tag immutability in their registry, which Amazon ECR, Azure and others offer, so a tag can be pushed once and never moved.
Where did this image come from?
A digest proves you got the bytes you asked for. It says nothing about whether those bytes are what your build produced. The registry can hold that evidence alongside the image. Docker’s official images carry annotations on each index entry. These are the ones on nginx’s amd64 image, with two lines (an architecture tag and a Hub URL) left out:
org.opencontainers.image.base.digest=sha256:ab3b3c8c5159eebfca4376430132d53c4d425f869c765ecbe47177a030da575d
org.opencontainers.image.base.name=debian:trixie-slim
org.opencontainers.image.created=2026-11-24T04:17:33Z
org.opencontainers.image.revision=d6e8ee84e5fa87b7279a3a25b0b6de7d55c24f3e
org.opencontainers.image.source=https://github.com/nginx/docker-nginx.git#d6e8ee84e5fa87b7279a3a25b0b6de7d55c24f3e:mainline/debian
org.opencontainers.image.version=1.31.10
The index also points at an attestation manifest for each image. I downloaded the one for amd64. It holds two in-toto statements:
- An SBOM (software bill of materials) in SPDX format, listing 236 packages, including
nginx 1.31.10-1~trixieandopenssl 3.5.9-1~deb13u1. When the next OpenSSL vulnerability is announced, this answers “are we affected?” without starting the container. - SLSA provenance, which records the builder (
https://github.com/docker-library), the build type (BuildKit) and the source it built from, the same Git URL and commit as the annotation.
There is a catch, and it is the important part. These statements are stored by whoever pushed the image. Someone who can push a malicious image can push a matching false SBOM next to it. Provenance only means something when it is signed by a builder you trust, and the signature is checked before deployment. The common tool is Sigstore’s cosign. In its keyless mode, a CI job signs with a short-lived certificate tied to its OIDC identity, and the signature is recorded in a public transparency log. I did not check any signatures here. Verifying at deploy time, and making the cluster refuse unsigned images, belongs to securing the pipeline and the supply chain.
About the video
“STOP using Docker Image TAGS | Digests and Digital Signatures explained” is from Marco Lenzo, published August 2023, 9 minutes 14 seconds. Its chapters cover why tags are risky, what a digest is, what a digital signature is, and Sigstore. The description frames tag swapping as a supply-chain attack, which is the security half of this lesson. It does not cover multi-architecture indexes or SBOM and provenance attestations, which this lesson adds from the registry itself. English was judged from the title, description, channel and its English auto-caption track. Ehsan Tatasadi’s video in deeper covers the same tag-versus-digest problem from a registry operator’s side.
Where this fits
You can now build an image and name it exactly. Running one copy is easy. Running fifty across ten machines, and keeping them running, is the next problem: why orchestration exists.
Check yourself
Two servers both run myapp:latest but behave differently. How is that possible?
Each pulled latest at a different time, and the tag was moved to a new image in between. The tag is a pointer, so the same name can resolve to different digests.
What does writing nginx@sha256:6a3d… in a manifest guarantee that nginx:1.31 does not?
The digest is a hash of the exact content, so the registry can only ever serve those bytes for it. A tag can be repointed by anyone with push access.
Why is provenance stored next to an image not enough on its own to trust the image?
Anyone who can push to the registry could push a false statement too. It needs a signature from a builder you trust, checked before you deploy.
What is the difference between an SBOM and provenance?
An SBOM lists the packages and versions inside the image. Provenance describes how it was built: which builder, from which source and commit, with which inputs.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.