instruction: How do you implement comprehensive container security scanning?
output: Content trust in Docker | Docker Docs Get started Guides Manuals Reference Ask&nbsp;AI { switch(e.key) { case 'k': if (e.metaKey || e.ctrlKey) { e.preventDefault(); $el.focus(); } break; } }" tabindex=0> Start typing to search or try Ask AI . Contact support { localStorage.setItem('theme-preference', value); document.firstElementChild.className = value; })" @click="theme = (theme === 'dark' ? 'light' : 'dark')"> { const container = $el; // The div with overflow const item = document.getElementById('sidebar-current-page') if (item) { const containerTop = container.scrollTop; const containerBottom = containerTop + container.clientHeight; const itemTop = item.offsetTop - container.offsetTop; const itemBottom = itemTop + item.offsetHeight; // Scroll only if the item is out of view if (itemBottom > containerBottom - 200) { container.scrollTop = itemTop - (container.clientHeight / 2 - item.offsetHeight / 2); } } })" class="bg-background-toc dark:bg-background-toc fixed top-0 z-40 hidden h-screen w-full flex-none overflow-x-hidden overflow-y-auto md:sticky md:top-16 md:z-auto md:block md:h-[calc(100vh-64px)] md:w-[320px]" :class="{ 'hidden': ! $store.showSidebar }"> Back Ask&nbsp;AI { switch(e.key) { case 'k': if (e.metaKey || e.ctrlKey) { e.preventDefault(); $el.focus(); } break; } }" tabindex=0> Start typing to search or try Ask AI . Contact support { localStorage.setItem('theme-preference', value); document.firstElementChild.className = value; })" @click="theme = (theme === 'dark' ? 'light' : 'dark')"> Manuals Get started Guides Reference Open source Docker Engine Install Ubuntu Debian RHEL Fedora Raspberry Pi OS (32-bit) CentOS SLES (s390x) Binaries Post-installation steps Storage Volumes Bind mounts tmpfs mounts Storage drivers Select a storage driver BTRFS storage driver Device Mapper storage driver (deprecated) OverlayFS storage driver VFS storage driver windowsfilter storage driver ZFS storage driver containerd image store Networking Packet filtering and firewalls Network drivers Bridge network driver Host network driver IPvlan network driver Macvlan network driver None network driver Overlay network driver Tutorials Networking using a macvlan network Networking using the host network Networking with overlay networks Networking with standalone containers CA certificates Legacy container links Containers Start containers automatically Run multiple processes in a container Resource constraints Runtime metrics Running containers CLI Completion Proxy configuration Filter commands Format command and log output OpenTelemetry for the Docker CLI Daemon Start the daemon Use IPv6 networking Daemon proxy configuration Live restore Alternative container runtimes Collect Docker metrics with Prometheus Configure remote access for Docker daemon Read the daemon logs Troubleshooting the Docker daemon Manage resources Docker contexts Docker object labels Prune unused Docker objects Logs and metrics Configure logging drivers Customize log driver output Logging drivers Amazon CloudWatch Logs logging driver ETW logging driver Fluentd logging driver Google Cloud Logging driver Graylog Extended Format logging driver Journald logging driver JSON File logging driver Local file logging driver Splunk logging driver Syslog logging driver Use a logging driver plugin Use docker logs with remote logging drivers Security Rootless mode Antivirus software and Docker AppArmor security profiles for Docker Content trust in Docker Automation with content trust Delegations for content trust Deploy Notary Server with Compose Manage keys for content trust Play in a content trust sandbox Docker security non-events Isolate containers with a user namespace Protect the Docker daemon socket Seccomp security profiles for Docker Verify repository client with certificates Swarm mode Administer and maintain a swarm of Docker Engines Deploy a stack to a swarm Deploy services to a swarm Getting started with Swarm mode Create a swarm Add nodes to the swarm Deploy a service to the swarm Inspect a service on the swarm Scale the service in the swarm Delete the service running on the swarm Apply rolling updates to a service Drain a node on the swarm How swarm works How nodes work How services work Manage swarm security with public key infrastructure (PKI) Swarm task states Join nodes to a swarm Lock your swarm to protect its encryption key Manage nodes in a swarm Manage sensitive data with Docker secrets Manage swarm service networks Raft consensus in swarm mode Run Docker Engine in swarm mode Store configuration data using Docker Configs Swarm mode key concepts Use Swarm mode routing mesh Deprecated features Docker Engine plugins Access authorization plugin Docker log driver plugins Docker network driver plugins Docker Plugin API Docker volume plugins Plugin Config Version 1 of Plugin V2 Use Docker Engine plugins Release notes Engine v28 Engine v27 Engine v26.1 Engine v26.0 Engine v25.0 Engine v24.0 Engine v23.0 Engine v20.10 Engine v19.03 Engine v18.09 Engine v18.06 Engine v18.05 Engine v18.04 Engine v18.03 Engine v18.02 Engine v18.01 Engine v17.12 Engine v17.11 Engine v17.10 Engine v17.09 Engine v17.07 Engine v17.06 Engine v17.05 Engine v17.04 Engine v17.03 Prior releases Docker Build Core concepts Docker Build Overview Dockerfile overview Build context Building Multi-stage Variables Secrets Multi-platform Export binaries Container Device Interface (CDI) Best practices Base images Build checks New Builders Build drivers Docker container driver Docker driver Kubernetes driver Remote driver Manage builders Bake Introduction Targets Inheritance Variables Expressions Functions Matrix targets Contexts Bake file reference Bake standard library functions Building with Bake from a Compose file Overriding configurations Remote Bake file definition Cache Build cache invalidation Build garbage collection Cache storage backends Amazon S3 cache Azure Blob Storage cache GitHub Actions cache Inline cache Local cache Registry cache Optimize cache usage in builds CI GitHub Actions Annotations Attestations Build checks Build secrets Build summary BuildKit configuration Cache management Copy image between registries Export to Docker Local registry Multi-platform image Named contexts Push to multiple registries Reproducible builds Share image between jobs Tags and labels Test before push Update Docker Hub description Metadata Annotations Build attestations Image attestation storage Provenance attestations SBOM attestations SLSA definitions Exporters Image and registry exporters Local and tar exporters OCI and Docker exporters BuildKit buildkitd.toml Configure BuildKit Custom Dockerfile syntax Dockerfile release notes Debugging OpenTelemetry support Build release notes Docker Compose Introduction to Compose How Compose works Why use Compose? History and development Install Plugin Standalone Uninstall Quickstart How-tos Specify a project name Use lifecycle hooks Use service profiles Control startup order Use environment variables Set environment variables Environment variables precedence Pre-defined environment variables Interpolation Best practices Build dependent images Use Compose Watch Secrets in Compose Networking Use multiple Compose files Merge Extend Include Enable GPU support Use Compose in production OCI artifact applications New Use provider services New Compose Bridge Usage Customize Support and feedback FAQs Give feedback Sample apps Releases Release notes Migrate to Compose v2 MCP Gateway Testcontainers AI Ask Gordon Beta Model Context Protocol (MCP) Built-in tools in Gordon Configure MCP servers with YAML Model Runner Beta Get started with DMR DMR REST API DMR examples MCP Catalog and Toolkit Beta MCP Catalog MCP Toolkit Hub MCP server AI and Docker Compose Use AI models in Compose New Products Docker Desktop Setup Install Mac Mac permission requirements Windows Windows permission requirements Linux Ubuntu Debian Fedora Arch RHEL VM or VDI environments Sign in Allowlist Explore Docker Desktop Containers Images Volumes Builds Resource Saver mode Pause Docker Desktop Features and capabilities Networking GPU support USB/IP support Deploy on Kubernetes Synchronized file shares containerd image store Wasm workloads Beta Docker Desktop CLI Virtual Machine Manager WSL Best practices Custom kernels on WSL Use WSL Settings and maintenance Change settings Backup and restore data Troubleshoot and support Troubleshoot and diagnose Common topics Known issues Get support for Docker Desktop FAQs General Mac Windows Linux Releases Give feedback Uninstall Fix startup issue for Mac Release notes Docker Hardened Images New Quickstart About Hardened images Image types Image testing Responsibility overview Features Flexibility Continuous patching Enterprise support Hardened, secure images Seamless integration How-tos Explore images Mirror an image Customize an image Use an image Verify an image Manage images Scan an image Enforce image usage Migrate an app Debug a container Core concepts Attestations CIS Benchmark Code signing CVEs Distroless images FIPS glibc and musl Hardening Image digests Image provenance Immutability SBOMs SLSA Software Supply Chain Security SSDLC STIG VEX Troubleshoot Docker Offload Beta Quickstart About Configure Usage & billing Optimize usage Troubleshoot Give feedback Docker Build Cloud Setup Usage Continuous integration Optimization Builder settings Release notes Docker Hub Quickstart Library Search Trusted content Catalogs Mirror Repositories Create Manage Repository information Access Images Tags Immutable tags Image Management Software artifacts Push images Move images Image security insights Webhooks Automated builds Set up Link accounts Automated repository tests Advanced options Manage autobuilds Troubleshoot Trusted content Docker Official Images Docker Verified Publisher Program Docker-Sponsored Open Source Program Insights and analytics Archive Delete Personal settings Usage and limits Pulls Optimize usage Service accounts Troubleshoot Release notes Docker Scout Install Quickstart Explore Dashboard Docker Scout image analysis Docker Scout metrics exporter Image details view Manage vulnerability exceptions How-tos Create an exception using the GUI Create an exception using the VEX Docker Scout environment variables Docker Scout SBOMs Use Scout with different artifact types Deep dive Advisory database sources and matching service Data collection and storage in Docker Scout Policy Evaluation Configure policies Docker Scout health scores Evaluate policy compliance in CI Remediation with Docker Scout View Docker Scout policy status Integrations Code quality SonarQube Container registries Amazon ECR Azure Container Registry Continuous Integration Azure DevOps Pipelines Circle CI GitHub Actions GitLab CI/CD Jenkins Integrating Docker Scout with environments Generic (CLI) Sysdig Source code management GitHub Team collaboration Slack Release notes CLI release notes Platform release notes Docker for GitHub Copilot EA Install Usage Example prompts Docker Extensions Marketplace extensions Non-marketplace extensions Configure a private marketplace Settings and feedback Extensions SDK The build and publish process Quickstart Part one: Build Create a simple extension Create an advanced frontend extension Add a backend to your extension Part two: Publish Add labels Validate Package and release your extension Share your extension Publish in the Marketplace Build multi-arch extensions Architecture Metadata Security Design and UI styling Guidelines Docker design principles MUI best practices Developer Guides Authentication Interacting with Kubernetes Invoke host binaries Use the Docker socket Developer SDK tools Test and debug Continuous Integration (CI) CLI reference Extension APIs Dashboard Docker Extension Backend Extension UI API Navigation Testcontainers Cloud Deprecated products and features Release lifecycle Platform Billing Add or update a payment method Manage your billing information 3D Secure authentication View billing history Change your billing cycle Submit a tax exemption certificate FAQs Docker accounts Accounts Create an account Manage an account Deactivate an account Security Personal access tokens Two-factor authentication Recover your Docker account FAQs General Container Network and VM Single sign-on General Domains Enforcement Identity providers User management Security announcements Subscription Subscriptions and features Set up your subscription Scale your subscription Manage seats Change your subscription Docker Desktop license agreement FAQs Release notes Enterprise Administration Organization administration Create your organization Onboard your organization Manage organization members Convert an account into an organization Create and manage a team Deactivate an organization Manage Docker products Activity logs Organization information Insights Company administration overview Create a company Manage company members Manage company organizations Manage company owners FAQ Organization Company Deploy Docker Desktop MSI installer PKG installer MS Store Deploy with Intune Deploy with Jamf Pro Microsoft Dev Box FAQs Security Single sign-on Configure Connect Manage Provision Just-in-Time SCIM Group mapping Enforce sign-in Configure Roles and permissions Manage domains Hardened Docker Desktop Enhanced Container Isolation Enable ECI Configure advanced settings Limitations FAQs Settings Management Use a JSON file Use the Admin Console Desktop settings reporting Settings reference Registry Access Management Image Access Management Air-gapped containers Organization access tokens Troubleshoot Troubleshoot provisioning Troubleshoot SSO Home / Manuals / Docker Engine / Security / Content trust in Docker Content trust in Docker Page options Copy page as Markdown for LLMs View page as plain text Ask questions with Docs AI Claude Open in Claude Table of contents About Docker Content Trust (DCT) Image tags and DCT Docker Content Trust Keys Signing images with Docker Content Trust Client enforcement with Docker Content Trust Related information When transferring data among networked systems, trust is a central concern. In particular, when communicating over an untrusted medium such as the internet, it is critical to ensure the integrity and the publisher of all the data a system operates on. You use Docker Engine to push and pull images (data) to a public or private registry. Content trust gives you the ability to verify both the integrity and the publisher of all the data received from a registry over any channel. About Docker Content Trust (DCT) Docker Content Trust (DCT) provides the ability to use digital signatures for data sent to and received from remote Docker registries. These signatures allow client-side or runtime verification of the integrity and publisher of specific image tags. Through DCT, image publishers can sign their images and image consumers can ensure that the images they pull are signed. Publishers could be individuals or organizations manually signing their content or automated software supply chains signing content as part of their release process. Image tags and DCT An individual image record has the following identifier: ]\s+/gm, '')); copying = true; setTimeout(() => copying = false, 2000);"> [REGISTRY_HOST[:REGISTRY_PORT]/]REPOSITORY[:TAG] A particular image REPOSITORY can have multiple tags. For example, latest and 3.1.2 are both tags on the mongo image. An image publisher can build an image and tag combination many times changing the image with each build. DCT is associated with the TAG portion of an image. Each image repository has a set of keys that image publishers use to sign an image tag. Image publishers have discretion on which tags they sign. An image repository can contain an image with one tag that is signed and another tag that is not. For example, consider the Mongo image repository . The latest tag could be unsigned while the 3.1.6 tag could be signed. It is the responsibility of the image publisher to decide if an image tag is signed or not. In this representation, some image tags are signed, others are not: Publishers can choose to sign a specific tag or not. As a result, the content of an unsigned tag and that of a signed tag with the same name may not match. For example, a publisher can push a tagged image someimage:latest and sign it. Later, the same publisher can push an unsigned someimage:latest image. This second push replaces the last unsigned tag latest but does not affect the signed latest version. The ability to choose which tags they can sign, allows publishers to iterate over the unsigned version of an image before officially signing it. Image consumers can enable DCT to ensure that images they use were signed. If a consumer enables DCT, they can only pull, run, or build with trusted images. Enabling DCT is a bit like applying a "filter" to your registry. Consumers "see" only signed image tags and the less desirable, unsigned image tags are "invisible" to them. To the consumer who has not enabled DCT, nothing about how they work with Docker images changes. Every image is visible regardless of whether it is signed or not. Docker Content Trust Keys Trust for an image tag is managed through the use of signing keys. A key set is created when an operation using DCT is first invoked. A key set consists of the following classes of keys: An offline key that is the root of DCT for an image tag Repository or tagging keys that sign tags Server-managed keys such as the timestamp key, which provides freshness security guarantees for your repository The following image depicts the various signing keys and their relationships: Warning The root key once lost is not recoverable. If you lose any other key, send an email to Docker Hub Support . This loss also requires manual intervention from every consumer that used a signed tag from this repository prior to the loss. You should back up the root key somewhere safe. Given that it is only required to create new repositories, it is a good idea to store it offline in hardware. For details on securing, and backing up your keys, make sure you read how to manage keys for DCT . Signing images with Docker Content Trust Within the Docker CLI we can sign and push a container image with the $ docker trust command syntax. This is built on top of the Notary feature set. For more information, see the Notary GitHub repository . A prerequisite for signing an image is a Docker Registry with a Notary server attached (Such as the Docker Hub ). Instructions for standing up a self-hosted environment can be found here . To sign a Docker Image you will need a delegation key pair. These keys can be generated locally using $ docker trust key generate or generated by a certificate authority. First we will add the delegation private key to the local Docker trust repository. (By default this is stored in ~/.docker/trust/ ). If you are generating delegation keys with $ docker trust key generate , the private key is automatically added to the local trust store. If you are importing a separate key, you will need to use the $ docker trust key load command. ]\s+/gm, '')); copying = true; setTimeout(() => copying = false, 2000);"> $ docker trust key generate jeff Generating key for jeff... Enter passphrase for new jeff key with ID 9deed25: Repeat passphrase for new jeff key with ID 9deed25: Successfully generated and loaded private key. Corresponding public key available: /home/ubuntu/Documents/mytrustdir/jeff.pub Or if you have an existing key: ]\s+/gm, '')); copying = true; setTimeout(() => copying = false, 2000);"> $ docker trust key load key.pem --name jeff Loading key from &#34;key.pem&#34;... Enter passphrase for new jeff key with ID 8ae710e: Repeat passphrase for new jeff key with ID 8ae710e: Successfully imported key from key.pem Next we will need to add the delegation public key to the Notary server; this is specific to a particular image repository in Notary known as a Global Unique Name (GUN). If this is the first time you are adding a delegation to that repository, this command will also initiate the repository, using a local Notary canonical root key. To understand more about initiating a repository, and the role of delegations, head to delegations for content trust . ]\s+/gm, '')); copying = true; setTimeout(() => copying = false, 2000);"> $ docker trust signer add --key cert.pem jeff registry.example.com/admin/demo Adding signer &#34;jeff&#34; to registry.example.com/admin/demo... Enter passphrase for new repository key with ID 10b5e94: Finally, we will use the delegation private key to sign a particular tag and push it up to the registry. ]\s+/gm, '')); copying = true; setTimeout(() => copying = false, 2000);"> $ docker trust sign registry.example.com/admin/demo:1 Signing and pushing trust data for local image registry.example.com/admin/demo:1, may overwrite remote trust data The push refers to repository [registry.example.com/admin/demo] 7bff100f35cb: Pushed 1: digest: sha256:3d2e482b82608d153a374df3357c0291589a61cc194ec4a9ca2381073a17f58e size: 528 Signing and pushing trust metadata Enter passphrase for signer key with ID 8ae710e: Successfully signed registry.example.com/admin/demo:1 Alternatively, once the keys have been imported an image can be pushed with the $ docker push command, by exporting the DCT environmental variable. ]\s+/gm, '')); copying = true; setTimeout(() => copying = false, 2000);"> $ export DOCKER_CONTENT_TRUST = 1 $ docker push registry.example.com/admin/demo:1 The push refers to repository [registry.example.com/admin/demo:1] 7bff100f35cb: Pushed 1: digest: sha256:3d2e482b82608d153a374df3357c0291589a61cc194ec4a9ca2381073a17f58e size: 528 Signing and pushing trust metadata Enter passphrase for signer key with ID 8ae710e: Successfully signed registry.example.com/admin/demo:1 Remote trust data for a tag or a repository can be viewed by the $ docker trust inspect command: ]\s+/gm, '')); copying = true; setTimeout(() => copying = false, 2000);"> $ docker trust inspect --pretty registry.example.com/admin/demo:1 Signatures for registry.example.com/admin/demo:1 SIGNED TAG DIGEST SIGNERS 1 3d2e482b82608d153a374df3357c0291589a61cc194ec4a9ca2381073a17f58e jeff List of signers and their keys for registry.example.com/admin/demo:1 SIGNER KEYS jeff 8ae710e3ba82 Administrative keys for registry.example.com/admin/demo:1 Repository Key: 10b5e94c916a0977471cc08fa56c1a5679819b2005ba6a257aa78ce76d3a1e27 Root Key: 84ca6e4416416d78c4597e754f38517bea95ab427e5f95871f90d460573071fc Remote Trust data for a tag can be removed by the $ docker trust revoke command: ]\s+/gm, '')); copying = true; setTimeout(() => copying = false, 2000);"> $ docker trust revoke registry.example.com/admin/demo:1 Enter passphrase for signer key with ID 8ae710e: Successfully deleted signature for registry.example.com/admin/demo:1 Client enforcement with Docker Content Trust Content trust is disabled by default in the Docker Client. To enable it, set the DOCKER_CONTENT_TRUST environment variable to 1 . This prevents users from working with tagged images unless they contain a signature. When DCT is enabled in the Docker client, docker CLI commands that operate on tagged images must either have content signatures or explicit content hashes. The commands that operate with DCT are: push build create pull run For example, with DCT enabled a docker pull someimage:latest only succeeds if someimage:latest is signed. However, an operation with an explicit content hash always succeeds as long as the hash exists: ]\s+/gm, '')); copying = true; setTimeout(() => copying = false, 2000);"> $ docker pull registry.example.com/user/image:1 Error: remote trust data does not exist for registry.example.com/user/image: registry.example.com does not have trust data for registry.example.com/user/image $ docker pull registry.example.com/user/image@sha256:d149ab53f8718e987c3a3024bb8aa0e2caadf6c0328f1d9d850b2a2a67f2819a sha256:ee7491c9c31db1ffb7673d91e9fac5d6354a89d0e97408567e09df069a1687c1: Pulling from user/image ff3a5c916c92: Pull complete a59a168caba3: Pull complete Digest: sha256:ee7491c9c31db1ffb7673d91e9fac5d6354a89d0e97408567e09df069a1687c1 Status: Downloaded newer image for registry.example.com/user/image@sha256:ee7491c9c31db1ffb7673d91e9fac5d6354a89d0e97408567e09df069a1687c1 Related information Delegations for content trust Automation with content trust Manage keys for content trust Play in a content trust sandbox Edit this page Request changes Table of contents About Docker Content Trust (DCT) Image tags and DCT Docker Content Trust Keys Signing images with Docker Content Trust Client enforcement with Docker Content Trust Related information Product offerings Pricing About us Contribute Read llms.txt Cookies Settings Terms of Service Status Legal Copyright © 2013-2025 Docker Inc. All rights reserved.