-
Notifications
You must be signed in to change notification settings - Fork 557
docs: add descriptions and examples for buildx history commands #3127
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
Merged
tonistiigi
merged 5 commits into
docker:master
from
sarahsanders-docker:docs-buildx-history
May 5, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4dac529
Add descriptions and examples for buildx history commands
sarahsanders-docker 23ce21c
feedback + updated examples + added links for h3 headings
sarahsanders-docker 0301904
addressed feedback
sarahsanders-docker 6ed39b2
fix examples and headings
sarahsanders-docker e1e8f5c
docs: updated reference docs generation
tonistiigi 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
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 |
---|---|---|
|
@@ -21,13 +21,61 @@ Inspect a build | |
|
||
<!---MARKER_GEN_END--> | ||
|
||
## Description | ||
|
||
Inspect a build record to view metadata such as duration, status, build inputs, | ||
platforms, outputs, and attached artifacts. You can also use flags to extract | ||
provenance, SBOMs, or other detailed information. | ||
|
||
## Examples | ||
|
||
### Inspect the most recent build | ||
|
||
```console | ||
$ docker buildx history inspect | ||
Name: buildx (binaries) | ||
Context: . | ||
Dockerfile: Dockerfile | ||
VCS Repository: https://github.com/crazy-max/buildx.git | ||
VCS Revision: f15eaa1ee324ffbbab29605600d27a84cab86361 | ||
Target: binaries | ||
Platforms: linux/amd64 | ||
Keep Git Dir: true | ||
|
||
Started: 2025-02-07 11:56:24 | ||
Duration: 1m 1s | ||
Build Steps: 16/16 (25% cached) | ||
|
||
Image Resolve Mode: local | ||
|
||
Materials: | ||
URI DIGEST | ||
pkg:docker/docker/dockerfile@1 sha256:93bfd3b68c109427185cd78b4779fc82b484b0b7618e36d0f104d4d801e66d25 | ||
pkg:docker/[email protected]?platform=linux%2Famd64 sha256:2c49857f2295e89b23b28386e57e018a86620a8fede5003900f2d138ba9c4037 | ||
pkg:docker/tonistiigi/[email protected]?platform=linux%2Famd64 sha256:923441d7c25f1e2eb5789f82d987693c47b8ed987c4ab3b075d6ed2b5d6779a3 | ||
|
||
Attachments: | ||
DIGEST PLATFORM TYPE | ||
sha256:217329d2af959d4f02e3a96dcbe62bf100cab1feb8006a047ddfe51a5397f7e3 https://slsa.dev/provenance/v0.2 | ||
``` | ||
|
||
### Inspect a specific build | ||
|
||
```console | ||
# Using a build ID | ||
docker buildx history inspect qu2gsuo8ejqrwdfii23xkkckt | ||
|
||
# Or using a relative offset | ||
docker buildx history inspect ^1 | ||
``` | ||
|
||
### <a name="format"></a> Format the output (--format) | ||
|
||
The formatting options (`--format`) pretty-prints the output to `pretty` (default), | ||
`json` or using a Go template. | ||
|
||
**Pretty output** | ||
|
||
```console | ||
$ docker buildx history inspect | ||
Name: buildx (binaries) | ||
|
@@ -57,6 +105,7 @@ sha256:217329d2af959d4f02e3a96dcbe62bf100cab1feb8006a047ddfe51a5397f7e3 | |
|
||
Print build logs: docker buildx history logs g9808bwrjrlkbhdamxklx660b | ||
``` | ||
**JSON output** | ||
|
||
```console | ||
$ docker buildx history inspect --format json | ||
|
@@ -111,6 +160,8 @@ $ docker buildx history inspect --format json | |
} | ||
``` | ||
|
||
**Go template output** | ||
|
||
```console | ||
$ docker buildx history inspect --format "{{.Name}}: {{.VCSRepository}} ({{.VCSRevision}})" | ||
buildx (binaries): https://github.com/crazy-max/buildx.git (f15eaa1ee324ffbbab29605600d27a84cab86361) | ||
|
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 |
---|---|---|
|
@@ -5,13 +5,78 @@ Inspect a build attachment | |
|
||
### Options | ||
|
||
| Name | Type | Default | Description | | ||
|:----------------|:---------|:--------|:-----------------------------------------| | ||
| `--builder` | `string` | | Override the configured builder instance | | ||
| `-D`, `--debug` | `bool` | | Enable debug logging | | ||
| `--platform` | `string` | | Platform of attachment | | ||
| `--type` | `string` | | Type of attachment | | ||
| Name | Type | Default | Description | | ||
|:------------------|:---------|:--------|:-----------------------------------------| | ||
| `--builder` | `string` | | Override the configured builder instance | | ||
| `-D`, `--debug` | `bool` | | Enable debug logging | | ||
| `--platform` | `string` | | Platform of attachment | | ||
| [`--type`](#type) | `string` | | Type of attachment | | ||
|
||
|
||
<!---MARKER_GEN_END--> | ||
|
||
## Description | ||
|
||
Inspect a specific attachment from a build record, such as a provenance file or | ||
SBOM. Attachments are optional artifacts stored with the build and may be | ||
platform-specific. | ||
|
||
## Examples | ||
|
||
### <a name="type"></a> Inspect a provenance attachment from a build (--type) | ||
|
||
Supported types include `provenance` and `sbom`. | ||
|
||
```console | ||
$ docker buildx history inspect attachment qu2gsuo8ejqrwdfii23xkkckt --type provenance | ||
{ | ||
"_type": "https://slsa.dev/provenance/v0.2", | ||
"buildDefinition": { | ||
"buildType": "https://build.docker.com/BuildKit@v1", | ||
"externalParameters": { | ||
"target": "app", | ||
"platforms": ["linux/amd64"] | ||
} | ||
}, | ||
"runDetails": { | ||
"builder": "docker", | ||
"by": "[email protected]" | ||
} | ||
} | ||
``` | ||
|
||
### Inspect a SBOM for linux/amd64 | ||
|
||
```console | ||
$ docker buildx history inspect attachment ^0 \ | ||
--type sbom \ | ||
--platform linux/amd64 | ||
{ | ||
"bomFormat": "CycloneDX", | ||
"specVersion": "1.5", | ||
"version": 1, | ||
"components": [ | ||
{ | ||
"type": "library", | ||
"name": "alpine", | ||
"version": "3.18.2" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Inspect an attachment by digest | ||
|
||
You can inspect an attachment directly using its digset, which you can get from | ||
the `inspect` output: | ||
|
||
```console | ||
# Using a build ID | ||
docker buildx history inspect attachment qu2gsuo8ejqrwdfii23xkkckt sha256:abcdef123456... | ||
|
||
# Or using a relative offset | ||
docker buildx history inspect attachment ^0 sha256:abcdef123456... | ||
``` | ||
|
||
Use `--type sbom` or `--type provenance` to filter attachments by type. To | ||
inspect a specific attachment by digest, omit the `--type` flag. |
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
Oops, something went wrong.
Oops, something went wrong.
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.