Skip to main content

Docker Content Trust

Docker Content Trust (DCT) is a Docker feature that signs image tags on push and verifies signatures on pull, using Notary and The Update Framework. With it enabled, the Docker CLI refuses unsigned tags.

What DCT protects against

If an attacker alters an image in a registry or intercepts the pull, a tag could point to malicious content. DCT lets publishers sign the tag-to-image mapping with keys, and clients verify that signature before using the image. It relies on a key hierarchy (root, targets, snapshot, timestamp) so a single compromised key does not break the whole trust chain.

Enable and use

Bash
export DOCKER_CONTENT_TRUST=1
docker pull nginx:1.27 # verified when signed
docker pull some-unsigned-image:latest # rejected
docker trust key generate myteam
docker push registry.example.com/payment-api:v3.1.0 # signs on push when DCT is on
docker trust inspect --pretty registry.example.com/payment-api:v3.1.0

Modern alternative: Sigstore cosign

Bash
cosign sign registry.example.com/payment-api:v3.1.0
cosign verify registry.example.com/payment-api:v3.1.0 \
--certificate-identity-regexp '.*' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com

Cosign supports keyless signing with OIDC identities, works with any OCI registry, and integrates with Kubernetes admission policies. Adjust the identity and issuer values to match your pipeline.

Remember

DCT works on tags. A reference by digest already identifies exact content, so signature verification adds mostly provenance, meaning who published it.

Security

Enabling DCT globally breaks pulls of unsigned base images. Roll it out per pipeline and sign what you build.

Frequently Asked Questions

What attack does Docker Content Trust address?

It addresses tag substitution and tampering, where a compromised registry or network path serves a malicious image under a trusted tag. Signature verification makes the CLI reject content that the publisher did not sign.

Why do few teams use DCT today?

It forces every image to be signed and breaks unsigned pulls, which is a heavy operational change. Many teams now use Sigstore cosign with admission policies, which is more flexible and supports keyless signing.

Does pinning by digest replace signing?

They solve different problems. A digest guarantees you get the exact bytes you reference, while a signature proves who vouched for those bytes. Strong supply chain security often uses both.

Found a mistake, an outdated step or a broken link?