Skip to content
Blog

Image Signing and Docker Content Trust Fundamentals

Understanding Docker Content Trust (DCT), The Update Framework (TUF), notary delegation keys, and enforcing DOCKER_CONTENT_TRUST=1 for signed image verification.

Published on • November 18, 2026

AI Assistant

In open container environments, pulling an image tag like redis:latest relies on trust that the remote registry server has not been tampered with. Docker Content Trust (DCT) provides cryptographic verification ensuring that container images are signed by authorized publishers before they are pushed or pulled.

DCT is powered by Notary and The Update Framework (TUF) specification, protecting container deployments against Man-in-the-Middle (MitM) attacks, registry key compromises, and rogue image injection.

In this tutorial, we will explore Docker Content Trust fundamentals, key management roles, enabling DCT enforcement, and signing images in CI pipelines.

How Docker Content Trust (DCT) Works

+-----------------------------------------------------------------------------------+
| Developer / Build Engine                                                          |
|  1. Builds Image                                                                  |
|  2. Signs Image Manifest SHA-256 with Private Delegation Key                      |
|  3. Pushes Image to Registry + Digital Signature to Notary Server                 |
+-----------------------------------------------------------------------------------+
                                          |
                                          v
+-----------------------------------------------------------------------------------+
| Docker Daemon Host (With DOCKER_CONTENT_TRUST=1)                                  |
|  1. Intercepts `docker pull` or `docker run`                                      |
|  2. Queries Notary Server for Trusted Public Keys & Signature Metadata            |
|  3. Verifies Cryptographic Signature matches Image Manifest SHA-256               |
|     --> If Valid  : Container Executes                                            |
|     --> If Invalid: Operation ABORTED with Security Error!                        |
+-----------------------------------------------------------------------------------+

The TUF Key Hierarchy

DCT uses four distinct key roles defined by The Update Framework (TUF) to prevent single-point key compromises:

  1. Root Key: The master root of trust for an image repository. Must be kept offline in secure cold storage.
  2. Targets Key: Signs repository tag changes and delegates signing authority to specific team members.
  3. Snapshot Key: Signs a hash of the current repository state to prevent replay or mix-and-match attacks.
  4. Timestamp Key: Issued by the Notary server to ensure metadata freshness and prevent freeze attacks.

Enabling Docker Content Trust

DCT enforcement is built directly into the standard Docker CLI. You can enable it globally by setting the DOCKER_CONTENT_TRUST environment variable:

export DOCKER_CONTENT_TRUST=1

Testing DCT Enforcement

Once DOCKER_CONTENT_TRUST=1 is set, try pulling an unsigned community image:

docker pull unsigneduser/random-app:v1

Output:

Error: remote trust metadata unavailable for docker.io/unsigneduser/random-app: No trust data file found

The Docker Engine strictly refuses to download or run any container image that lacks a valid digital signature!

Signing and Pushing Images

When DOCKER_CONTENT_TRUST=1 is enabled, running docker push automatically triggers the signature creation workflow:

# 1. Enable Content Trust
export DOCKER_CONTENT_TRUST=1

# 2. Push image (Triggers prompt for Root Key and Repository Key passphrases)
docker push myorg/secure-app:v1.0.0

Console Output:

The push refers to repository [docker.io/myorg/secure-app]
a29b4e710d22: Pushed 
Signing and pushing trust metadata
Enter passphrase for root key: 
Enter passphrase for repository key: 
Finished initializing "docker.io/myorg/secure-app"
Successfully signed "docker.io/myorg/secure-app:v1.0.0"

Inspecting Trust Metadata

You can inspect the signatures and public keys associated with a repository using docker trust:

docker trust inspect --pretty myorg/secure-app:v1.0.0

Sample output:

Signatures for myorg/secure-app:v1.0.0

SIGNED TAG   DIGEST                                                             SIGNED BY
v1.0.0       sha256:4c0f3f20865ebd3757f40660bc9b7b038b69da3851ab424a2ae...      (Released Name)

Administrative keys for myorg/secure-app:
  Repository Key: 7f8a91b2c3d4...

Managing Delegation Keys for CI/CD

To allow automated CI/CD runners (like GitHub Actions) to sign images without embedding the master Root Key:

  1. Generate a Delegation Key Pair:

    docker trust key generate ci-builder
  2. Add Delegation Key to Repository:

    docker trust signer add --key ci-builder.pub ci-builder myorg/secure-app
  3. Sign with Delegation Key in CI Pipeline: Import ci-builder.key as a CI secret and set DOCKER_CONTENT_TRUST=1.

Summary & Best Practices

RecommendationAction
Enforce in ProductionSet DOCKER_CONTENT_TRUST=1 on production Kubernetes nodes.
Protect Root KeysStore master Root Key passphrases and files in hardware tokens or password vaults.
Use Delegation KeysNever put Root Keys in CI/CD pipelines; use scoped Delegation Keys.
Modern AlternativeFor OCI-native keyless signing, also explore Cosign/Sigstore alongside DCT.

Enforcing Docker Content Trust ensures that only cryptographically verified, team-approved container images can run in your production infrastructure.