DevOps · Guide

Registries & Image Scanning

Where images live, why digests beat tags, and catching a known vulnerability before it reaches production.

— min read DevOps

The Registry Is Part Of Production

A registry is not just storage. It is the boundary between what was built and what runs, so it is where provenance, scanning and promotion belong.

An image is layers plus a manifest, addressed by a content digest — a hash of the manifest. Tags are mutable pointers to digests, which is convenient and is why myapp:1.4.2 is not a guarantee of anything.

Tags Versus Digests

TagDigest
Examplemyapp:1.4.2myapp@sha256:9f2c…
MutableYes — can be repointedNo, by construction
ReproducibleNot guaranteedAlways the same bytes
Use forHumans reading a changelogAnything a machine deploys
:latest means "whatever was pushed most recently", so two nodes pulling at different times can run different code under the same name — and the difference is invisible in every dashboard you own.
# build once, tag for humans, deploy by digest
docker build -t registry.acme.io/orders:1.4.2 .
docker push registry.acme.io/orders:1.4.2

# the deploy manifest references the immutable digest
image: registry.acme.io/orders@sha256:9f2c1b7d…

Set a retention policy early. Registries grow without limit, and the storage bill for six years of every CI build is a genuinely surprising line item.

Vulnerability Scanning

Scanners compare the packages in an image against vulnerability databases. Almost everything they find comes from the base image and transitive dependencies, not from code anyone on the team wrote.

Where to scanCatches
In CI, before pushStops a bad image from ever existing in the registry
In the registry, continuouslyNew CVEs against images already built
At admission, in the clusterAnything that slipped through both
Scan continuously, not only at build. An image that was clean on Monday is vulnerable on Thursday because the CVE was published on Wednesday — nothing about the image changed.

The practical lever is a smaller base image. Distroless or Alpine bases carry a fraction of the packages, so most findings disappear because the vulnerable package was never installed. Fail the build on critical severity, and triage the rest — a policy that fails on everything gets switched off within a fortnight.

Signing, SBOMs & Promotion

Scanning asks whether the image is vulnerable. Provenance asks a different question: is this the image we built, from the source we think, by the pipeline we trust.

ArtefactAnswers
Signature (Cosign, Notary)Who produced this image, verifiable at admission
SBOMExactly what is inside it, for the next CVE
Build attestationWhich commit, which pipeline, which inputs
Admission policyRefuses anything unsigned or unscanned

An SBOM pays for itself the day a widely-used library CVE lands: instead of rebuilding and scanning everything to find out where it is, you query the SBOMs you already stored.

Promote the same digest through environments — never rebuild per environment. Rebuilding produces different bytes, so what you tested in staging is not what production runs, and the whole pipeline stops being evidence of anything.

Interview Questions

Tag or digest for deployments?

Digest. Tags are mutable pointers, so two pulls of the same tag can produce different images; a digest is the content hash and always resolves to the same bytes.

Why is :latest dangerous?

It means whatever was pushed most recently, so nodes pulling at different times run different code under one name, and no dashboard shows the difference.

Why scan images continuously rather than once?

CVEs are published after the build. An unchanged image becomes vulnerable the day a new advisory lands, so registry-side rescanning is what catches it.

What is the most effective way to reduce findings?

A smaller base image. Distroless or Alpine bases carry far fewer packages, so most vulnerabilities disappear because the package was never present.

What does image signing give you that scanning does not?

Provenance. A signature verified at admission proves the image came from your pipeline, which scanning — a statement about contents — never establishes.

Why promote the same digest instead of rebuilding?

A rebuild produces different bytes, so production runs something that was never tested. Promoting the tested digest is what makes the pipeline meaningful.

Quick Quiz

1. A digest differs from a tag because it is…
2. Most scanner findings originate in…
3. An image clean at build can become vulnerable because…
4. An SBOM is most useful when…
5. Rebuilding an image per environment means…