11command : docker buildx history export
2- short : Export a build into Docker Desktop bundle
3- long : Export a build into Docker Desktop bundle
4- usage : docker buildx history export [OPTIONS] [REF]
2+ short : Export build records into Docker Desktop bundle
3+ long : |-
4+ Export one or more build records to `.dockerbuild` archive files. These archives
5+ contain metadata, logs, and build outputs, and can be imported into Docker
6+ Desktop or shared across environments.
7+ usage : docker buildx history export [OPTIONS] [REF...]
58pname : docker buildx history
69plink : docker_buildx_history.yaml
710options :
811 - option : all
912 value_type : bool
1013 default_value : " false"
11- description : Export all records for the builder
14+ description : Export all build records for the builder
15+ details_url : ' #all'
16+ deprecated : false
17+ hidden : false
18+ experimental : false
19+ experimentalcli : false
20+ kubernetes : false
21+ swarm : false
22+ - option : finalize
23+ value_type : bool
24+ default_value : " false"
25+ description : Ensure build records are finalized before exporting
26+ details_url : ' #finalize'
1227 deprecated : false
1328 hidden : false
1429 experimental : false
@@ -19,6 +34,7 @@ options:
1934 shorthand : o
2035 value_type : string
2136 description : Output file path
37+ details_url : ' #output'
2238 deprecated : false
2339 hidden : false
2440 experimental : false
@@ -29,6 +45,7 @@ inherited_options:
2945 - option : builder
3046 value_type : string
3147 description : Override the configured builder instance
48+ details_url : ' #builder'
3249 deprecated : false
3350 hidden : false
3451 experimental : false
@@ -40,12 +57,78 @@ inherited_options:
4057 value_type : bool
4158 default_value : " false"
4259 description : Enable debug logging
60+ details_url : ' #debug'
4361 deprecated : false
4462 hidden : false
4563 experimental : false
4664 experimentalcli : false
4765 kubernetes : false
4866 swarm : false
67+ examples : |-
68+ ### Export all build records to a file (--all) {#all}
69+
70+ Use the `--all` flag and redirect the output:
71+
72+ ```console
73+ docker buildx history export --all > all-builds.dockerbuild
74+ ```
75+
76+ Or use the `--output` flag:
77+
78+ ```console
79+ docker buildx history export --all -o all-builds.dockerbuild
80+ ```
81+
82+ ### Use a specific builder instance (--builder) {#builder}
83+
84+ ```console
85+ docker buildx history export --builder builder0 ^1 -o builder0-build.dockerbuild
86+ ```
87+
88+ ### Enable debug logging (--debug) {#debug}
89+
90+ ```console
91+ docker buildx history export --debug qu2gsuo8ejqrwdfii23xkkckt -o debug-build.dockerbuild
92+ ```
93+
94+ ### Ensure build records are finalized before exporting (--finalize) {#finalize}
95+
96+ Clients can report their own traces concurrently, and not all traces may be
97+ saved yet by the time of the export. Use the `--finalize` flag to ensure all
98+ traces are finalized before exporting.
99+
100+ ```console
101+ docker buildx history export --finalize qu2gsuo8ejqrwdfii23xkkckt -o finalized-build.dockerbuild
102+ ```
103+
104+ ### Export a single build to a custom file (--output) {#output}
105+
106+ ```console
107+ docker buildx history export qu2gsuo8ejqrwdfii23xkkckt --output mybuild.dockerbuild
108+ ```
109+
110+ You can find build IDs by running:
111+
112+ ```console
113+ docker buildx history ls
114+ ```
115+
116+ To export two builds to separate files:
117+
118+ ```console
119+ # Using build IDs
120+ docker buildx history export qu2gsuo8ejqrwdfii23xkkckt qsiifiuf1ad9pa9qvppc0z1l3 -o multi.dockerbuild
121+
122+ # Or using relative offsets
123+ docker buildx history export ^1 ^2 -o multi.dockerbuild
124+ ```
125+
126+ Or use shell redirection:
127+
128+ ```console
129+ docker buildx history export ^1 > mybuild.dockerbuild
130+ docker buildx history export ^2 > backend-build.dockerbuild
131+ ```
49132deprecated : false
50133hidden : false
51134experimental : false
0 commit comments