Skip to content

Commit 4dac529

Browse files
sarahsanders-dockertonistiigi
authored andcommitted
Add descriptions and examples for buildx history commands
Signed-off-by: sarahsanders-docker <sarah.sanders@docker.com>
1 parent 9a48aca commit 4dac529

9 files changed

Lines changed: 237 additions & 0 deletions

docs/reference/buildx_history_export.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,31 @@ Export a build into Docker Desktop bundle
1515

1616
<!---MARKER_GEN_END-->
1717

18+
## Description
19+
20+
Export one or more build records to `.dockerbuild` archive files. These archives
21+
contain metadata, logs, and build outputs, and can be imported into Docker
22+
Desktop or shared across environments.
23+
24+
## Examples
25+
26+
### Export a single build to a custom file
27+
28+
```console
29+
docker buildx history export mybuild --output mybuild.dockerbuild
30+
```
31+
32+
### Export multiple builds to individual `.dockerbuild` files
33+
34+
This example writes `mybuild.dockerbuild` and `backend-build.dockerbuild` to
35+
the current directory:
36+
37+
```console
38+
docker buildx history export mybuild backend-build
39+
```
40+
41+
### Export all build records
42+
43+
```console
44+
docker buildx history export --all
45+
```

docs/reference/buildx_history_import.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,28 @@ Import a build into Docker Desktop
1414

1515
<!---MARKER_GEN_END-->
1616

17+
## Description
18+
19+
Import a build record from a `.dockerbuild` archive into Docker Desktop. This
20+
lets you view, inspect, and analyze builds created in other environments or CI
21+
pipelines.
22+
23+
## Examples
24+
25+
### Import a `.dockerbuild` archive into Docker Desktop
26+
27+
```console
28+
docker buildx history import < mybuild.dockerbuild
29+
```
30+
31+
### Import a file using a specific path
32+
33+
```console
34+
docker buildx history import --file ./artifacts/backend-build.dockerbuild
35+
```
36+
37+
### Import a file and open it in Docker Desktop
38+
39+
```console
40+
docker buildx history import --file ./ci-build.dockerbuild && docker buildx history open ci-build
41+
```

docs/reference/buildx_history_inspect.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,20 @@ Inspect a build
2121

2222
<!---MARKER_GEN_END-->
2323

24+
## Description
25+
26+
Inspect a build record to view metadata such as duration, status, build inputs,
27+
platforms, outputs, and attached artifacts. You can also use flags to extract
28+
provenance, SBOMs, or other detailed information.
29+
2430
## Examples
2531

32+
### Inspect a build and print metadata
33+
34+
```console
35+
docker buildx history inspect mybuild
36+
```
37+
2638
### <a name="format"></a> Format the output (--format)
2739

2840
The formatting options (`--format`) pretty-prints the output to `pretty` (default),

docs/reference/buildx_history_inspect_attachment.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,24 @@ Inspect a build attachment
1515

1616
<!---MARKER_GEN_END-->
1717

18+
## Description
19+
20+
Inspect a specific attachment from a build record, such as a provenance file or
21+
SBOM. Attachments are optional artifacts stored with the build and may be
22+
platform-specific.
23+
24+
## Examples
25+
26+
### Inspect a provenance attachment from a build
27+
28+
```console
29+
docker buildx history inspect attachment mybuild --type https://slsa.dev/provenance/v0.2
30+
```
31+
32+
### Inspect a SBOM for linux/amd64
33+
34+
```console
35+
docker buildx history inspect attachment mybuild \
36+
--type application/vnd.cyclonedx+json \
37+
--platform linux/amd64
38+
```

docs/reference/buildx_history_logs.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,34 @@ Print the logs of a build
1414

1515
<!---MARKER_GEN_END-->
1616

17+
## Description
18+
19+
Print the logs for a completed build. The output appears in the same format as `--progress=plain`, showing the full logs for each step without multiplexing.
20+
21+
By default, this shows logs for the most recent build on the current builder.
22+
23+
## Examples
24+
25+
### Print logs for the most recent build
26+
27+
```console
28+
docker buildx history logs
29+
```
30+
31+
### Print logs for a specific build
32+
33+
```console
34+
docker buildx history logs mybuild
35+
```
36+
37+
### Print logs in JSON format
38+
39+
```console
40+
docker buildx history logs mybuild --progress rawjson
41+
```
42+
43+
### Print logs in TTY format
44+
45+
```console
46+
docker buildx history logs mybuild --progress tty
47+
```

docs/reference/buildx_history_ls.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,48 @@ List build records
1717

1818
<!---MARKER_GEN_END-->
1919

20+
## Description
21+
22+
List completed builds recorded by the active builder. Each entry includes the
23+
build ID, name (if available), status, timestamp, and duration.
24+
25+
By default, only records for the current builder are shown. You can filter
26+
results using flags.
27+
28+
## Examples
29+
30+
### List all build records for the current builder
31+
32+
```console
33+
docker buildx history ls
34+
```
35+
36+
### List only failed builds
37+
38+
```console
39+
docker buildx history ls --filter status=error
40+
```
41+
42+
### List builds from the current directory
43+
44+
```console
45+
docker buildx history ls --local
46+
```
47+
48+
### Display full output without truncation
49+
50+
```console
51+
docker buildx history ls --no-trunc
52+
```
53+
54+
### Format output as JSON
55+
56+
```console
57+
docker buildx history ls --format json
58+
```
59+
60+
### Use a Go template to print name and durations
61+
62+
```console
63+
docker buildx history ls --format '{{.Name}} - {{.Duration}}'
64+
```

docs/reference/buildx_history_open.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,20 @@ Open a build in Docker Desktop
1313

1414
<!---MARKER_GEN_END-->
1515

16+
## Description
17+
18+
Open a build record in Docker Desktop for visual inspection. This requires Docker Desktop to be installed and running on the host machine.
19+
20+
## Examples
21+
22+
### Open the most recent build in Docker Desktop
23+
24+
```console
25+
docker buildx history open
26+
```
27+
28+
### Open a specific build by name
29+
30+
```console
31+
docker buildx history open mybuild
32+
```

docs/reference/buildx_history_rm.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,28 @@ Remove build records
1414

1515
<!---MARKER_GEN_END-->
1616

17+
## Description
18+
19+
Remove one or more build records from the current builder’s history. You can
20+
remove specific builds by name or ID, or delete all records at once using
21+
the `--all` flag.
22+
23+
## Examples
24+
25+
### Remove a specific build
26+
27+
```console
28+
docker buildx history rm mybuild
29+
```
30+
31+
### Remove multiple builds
32+
33+
```console
34+
docker buildx history rm mybuild frontend-build backend-build
35+
```
36+
37+
### Remove all build records from the current builder
38+
39+
```console
40+
docker buildx history rm --all
41+
```

docs/reference/buildx_history_trace.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,36 @@ Show the OpenTelemetry trace of a build record
1515

1616
<!---MARKER_GEN_END-->
1717

18+
## Description
19+
20+
View the OpenTelemetry trace for a completed build. This command loads the
21+
trace into a Jaeger UI running in a local container
22+
(or a custom instance if configured) and opens it in your browser.
23+
24+
This helps analyze build performance, step timing, and internal execution flows.
25+
26+
## Examples
27+
28+
### Open the OpenTelemetry trace for the most recent build
29+
30+
```console
31+
docker buildx history trace
32+
```
33+
34+
### Open the trace for a specific build
35+
36+
```console
37+
docker buildx history trace mybuild
38+
```
39+
40+
### Run the Jaeger UI on a specific port
41+
42+
```console
43+
docker buildx history trace mybuild --addr 127.0.0.1:16686
44+
```
45+
46+
### Compare two build traces
47+
48+
```console
49+
docker buildx history trace --compare mybuild:main mybuild:feature
50+
```

0 commit comments

Comments
 (0)