@@ -5,13 +5,77 @@ Export a build into Docker Desktop bundle
55
66### Options
77
8- | Name | Type | Default | Description |
9- | :-----------------| :---------| :--------| :-----------------------------------------|
10- | ` --all ` | ` bool ` | | Export all records for the builder |
11- | ` --builder ` | ` string ` | | Override the configured builder instance |
12- | ` -D ` , ` --debug ` | ` bool ` | | Enable debug logging |
13- | ` -o ` , ` --output ` | ` string ` | | Output file path |
8+ | Name | Type | Default | Description |
9+ | :--------------------------------------- | :---------| :--------| :-----------------------------------------|
10+ | [ ` --all ` ] ( #all ) | ` bool ` | | Export all records for the builder |
11+ | [ ` --builder ` ] ( #builder ) | ` string ` | | Override the configured builder instance |
12+ | [ ` -D ` ] ( #debug ) , [ ` --debug ` ] ( #debug ) | ` bool ` | | Enable debug logging |
13+ | [ ` -o ` ] ( #output ) , [ ` --output ` ] ( #output ) | ` string ` | | Output file path |
1414
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+ ### <a name =" output " ></a > Export a single build to a custom file (--output)
27+
28+ ``` console
29+ docker buildx history export qu2gsuo8ejqrwdfii23xkkckt --output mybuild.dockerbuild
30+ ```
31+
32+ You can find build IDs by running:
33+
34+ ``` console
35+ docker buildx history ls
36+ ```
37+
38+ ### <a name =" o " ></a > Export multiple builds to individual ` .dockerbuild ` files (-o)
39+
40+ To export two builds to separate files:
41+
42+ ``` console
43+ # Using build IDs
44+ docker buildx history export qu2gsuo8ejqrwdfii23xkkckt qsiifiuf1ad9pa9qvppc0z1l3 -o multi.dockerbuild
45+
46+ # Or using relative offsets
47+ docker buildx history export ^1 ^2 -o multi.dockerbuild
48+ ```
49+
50+ Or use shell redirection:
51+
52+ ``` console
53+ docker buildx history export ^1 > mybuild.dockerbuild
54+ docker buildx history export ^2 > backend-build.dockerbuild
55+ ```
56+
57+ ### <a name =" all " ></a > Export all build records to a file (--all)
58+
59+ Use the ` --all ` flag and redirect the output:
60+
61+ ``` console
62+ docker buildx history export --all > all-builds.dockerbuild
63+ ```
64+
65+ Or use the ` --output ` flag:
66+
67+ ``` console
68+ docker buildx history export --all -o all-builds.dockerbuild
69+ ```
70+
71+ ### <a name =" builder " ></a > Use a specific builder instance (--builder)
72+
73+ ``` console
74+ docker buildx history export --builder builder0 ^1 -o builder0-build.dockerbuild
75+ ```
76+
77+ ### <a name =" debug " ></a > Enable debug logging (--debug)
78+
79+ ``` console
80+ docker buildx history export --debug qu2gsuo8ejqrwdfii23xkkckt -o debug-build.dockerbuild
81+ ```
0 commit comments