-
Notifications
You must be signed in to change notification settings - Fork 8.1k
dhi: feedback #23703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
craig-osterhout
wants to merge
2
commits into
docker:main
Choose a base branch
from
craig-osterhout:engdocs-3099
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+234
−19
Open
dhi: feedback #23703
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| --- | ||
| title: How Docker Hardened Images are built | ||
| linkTitle: Build process | ||
| description: Learn how Docker builds, tests, and maintains Docker Hardened Images through an automated, security-focused pipeline. | ||
| keywords: docker hardened images, slsa build level 3, automated patching, ai guardrail, build process, signed sbom, supply chain security | ||
| weight: 15 | ||
| --- | ||
|
|
||
| Docker Hardened Images are built through an automated pipeline that monitors | ||
| upstream sources, applies security updates, and publishes signed artifacts. | ||
| This page explains the build process for both DHI images and customized | ||
| images built from them. | ||
|
|
||
| ## Build triggers | ||
|
|
||
| Builds start automatically. You don't trigger them manually. The system monitors | ||
| for changes and starts builds in two scenarios: | ||
|
|
||
| - [Upstream updates](#upstream-updates) | ||
| - [Customization changes](#customization-changes) | ||
|
|
||
| ### Upstream updates | ||
|
|
||
| New releases, package updates, or CVE fixes from upstream projects trigger base | ||
| image rebuilds. These builds go through quality checks to ensure security and | ||
| reliability. | ||
|
|
||
| #### Monitoring for updates | ||
|
|
||
| Docker continuously monitors upstream projects for new releases, package | ||
| updates, and security advisories. When changes are detected, the system | ||
| automatically queues affected images for rebuild using a SLSA Build Level | ||
| 3-compliant build system. | ||
|
|
||
| Docker uses three strategies to track updates: | ||
|
|
||
| - GitHub releases: Monitors specific GitHub repositories for new releases and | ||
| automatically updates the image definition when a new version is published. | ||
| - GitHub tags: Tracks tags in GitHub repositories to detect new versions. | ||
| - Package repositories: Monitors Alpine Linux, Debian, and Ubuntu package | ||
| repositories through Docker Scout's package database to detect updated | ||
| packages. | ||
|
|
||
| In addition to explicit upstream tracking, Docker also monitors transitive | ||
| dependencies. When a package update is detected (for example, a security patch | ||
| for a library), Docker automatically identifies and rebuilds all images within | ||
| the support window that use that package. | ||
|
|
||
| ### Customization changes | ||
|
|
||
| Updates to your OCI artifact customizations trigger rebuilds of your customized | ||
| images. | ||
|
|
||
| When you customize a DHI image, your changes are packaged as OCI artifacts that | ||
| layer on top of the base image. Docker monitors your artifact repositories and | ||
| automatically rebuilds your customized images whenever you push updates. | ||
|
|
||
| The rebuild process fetches the current base image, applies your OCI artifacts, | ||
| signs the result, and publishes it automatically. You don't need to manage | ||
| builds or maintain CI pipelines for your customized images. | ||
|
|
||
| Customized images are also rebuilt automatically when the base DHI image they | ||
| depend on receives updates, ensuring your images always include the latest | ||
| security patches. | ||
|
|
||
| ## Build pipeline | ||
|
|
||
| The following sections describe the build pipeline architecture and workflow for | ||
| Docker Hardened Images based on: | ||
|
|
||
| - [Base image pipeline](#base-image-pipeline) | ||
| - [Customized image pipeline](#customized-image-pipeline) | ||
|
|
||
| ### Base image pipeline | ||
|
|
||
| Each Docker Hardened Image is built through an automated pipeline: | ||
|
|
||
| 1. Monitoring: Docker monitors upstream sources for updates (new releases, | ||
| package updates, security advisories). | ||
| 2. Rebuild trigger: When changes are detected, an automated rebuild starts. | ||
| 3. AI guardrail: An AI system fetches upstream diffs and scans them with | ||
| language-aware checks. The guardrail focuses on high-leverage issues that can | ||
| cause significant problems, such as inverted error checks, ignored failures, | ||
| resource mishandling, or suspicious contributor activity. When it spots | ||
| potential risks, it blocks the PR from auto-merging. | ||
| 4. Human review: If the AI identifies risks with high confidence, | ||
| Docker engineers review the flagged code, reproduce the issue, and decide on | ||
| the appropriate action. Engineers often contribute fixes back to upstream | ||
| projects, improving the code for the entire community. When fixes are accepted | ||
| upstream, the DHI build pipeline applies the patch immediately to protect | ||
| customers while the fix moves through the upstream release process. | ||
| 5. Testing: Images undergo comprehensive testing for compatibility and | ||
| functionality. | ||
| 6. Signing and attestations: Docker signs each image and generates | ||
| attestations (SBOMs, VEX documents, build provenance). | ||
| 7. Publishing: The signed image and attestations are published to Docker Hub. | ||
| 8. Cascade rebuilds: If any customized images use this base, their rebuilds | ||
| are automatically triggered. | ||
|
|
||
| Docker responds quickly to critical vulnerabilities. By building essential | ||
| components from source rather than waiting for packaged updates, Docker can | ||
| patch Critical and High-severity CVEs within days of upstream fixes and publish | ||
| updated images with new attestations. | ||
|
|
||
| The following diagram shows the base image build flow: | ||
|
|
||
| ```goat {class="text-sm"} | ||
| .-------------------. .-------------------. .-------------------. .-------------------. | ||
| | Docker monitors |----->| Trigger rebuild |----->| AI guardrail |----->| Human review | | ||
| | upstream sources | | | | scans changes | | | | ||
| '-------------------' '-------------------' '-------------------' '-------------------' | ||
| | | ||
| v | ||
| .-------------------. .-------------------. .-------------------. .-------------------. | ||
| | Cascade rebuilds |<-----| Publish to |<-----| Sign & generate |<-----| Testing | | ||
| | (if needed) | | Docker Hub | | attestations | | | | ||
| '-------------------' '-------------------' '-------------------' '-------------------' | ||
| ``` | ||
|
|
||
| ### Customized image pipeline | ||
|
|
||
| When you customize a DHI image, the build process is simplified: | ||
|
|
||
| 1. Monitoring: Docker monitors your OCI artifact repositories for changes. | ||
| 2. Rebuild trigger: When you push updates to your OCI artifacts, or when the base | ||
| DHI image is updated, an automated rebuild starts. | ||
| 3. Fetch base image: The latest base DHI image is fetched. | ||
| 4. Apply customizations: Your OCI artifacts are applied to the base image. | ||
| 5. Signing and attestations: Docker signs the customized image and generates | ||
| attestations (SBOMs, VEX documents, build provenance). | ||
| 6. Publishing: The signed customized image and attestations are published to | ||
| Docker Hub. | ||
|
|
||
| Docker handles the entire process automatically, so you don't need to manage | ||
| builds for your customized images. However, you're responsible for testing your | ||
| customized images and managing any CVEs introduced by your OCI artifacts. | ||
|
|
||
| The following diagram shows the customized image build flow: | ||
|
|
||
| ```goat {class="text-sm"} | ||
| .-------------------. .-------------------. .-------------------. | ||
| | Docker monitors |----->| Trigger rebuild |----->| Fetch base | | ||
| | OCI artifacts | | | | DHI image | | ||
| '-------------------' '-------------------' '-------------------' | ||
| | | ||
| v | ||
| .-------------------. .-------------------. .-------------------. | ||
| | Publish to |<-----| Sign & generate |<-----| Apply | | ||
| | Docker Hub | | attestations | | customizations | | ||
| '-------------------' '-------------------' '-------------------' | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.