Skip to content

Commit 3855262

Browse files
committed
build: regen buildx cli 68c3ac4
Signed-off-by: David Karlsson <[email protected]>
1 parent 368f2f2 commit 3855262

File tree

5 files changed

+230
-22
lines changed

5 files changed

+230
-22
lines changed

data/buildx/docker_buildx_build.yaml

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ long: |-
66
to the UI of `docker build` command and takes the same flags and arguments.
77
88
For documentation on most of these flags, refer to the [`docker build`
9-
documentation](/engine/reference/commandline/build/).
9+
documentation](/engine/reference/commandline/image_build/).
1010
This page describes a subset of the new flags.
1111
usage: docker buildx build [OPTIONS] PATH | URL | -
1212
pname: docker buildx
@@ -16,7 +16,7 @@ options:
1616
value_type: stringSlice
1717
default_value: '[]'
1818
description: 'Add a custom host-to-IP mapping (format: `host:ip`)'
19-
details_url: /engine/reference/commandline/build/#add-host
19+
details_url: /engine/reference/commandline/image_build/#add-host
2020
deprecated: false
2121
hidden: false
2222
experimental: false
@@ -106,7 +106,7 @@ options:
106106
- option: cgroup-parent
107107
value_type: string
108108
description: Set the parent cgroup for the `RUN` instructions during build
109-
details_url: /engine/reference/commandline/build/#cgroup-parent
109+
details_url: /engine/reference/commandline/image_build/#cgroup-parent
110110
deprecated: false
111111
hidden: false
112112
experimental: false
@@ -186,7 +186,7 @@ options:
186186
shorthand: f
187187
value_type: string
188188
description: 'Name of the Dockerfile (default: `PATH/Dockerfile`)'
189-
details_url: /engine/reference/commandline/build/#file
189+
details_url: /engine/reference/commandline/image_build/#file
190190
deprecated: false
191191
hidden: false
192192
experimental: false
@@ -296,6 +296,7 @@ options:
296296
value_type: stringArray
297297
default_value: '[]'
298298
description: Do not cache specified stages
299+
details_url: '#no-cache-filter'
299300
deprecated: false
300301
hidden: false
301302
experimental: false
@@ -487,7 +488,7 @@ options:
487488
value_type: stringArray
488489
default_value: '[]'
489490
description: 'Name and optionally a tag (format: `name:tag`)'
490-
details_url: /engine/reference/commandline/build/#tag
491+
details_url: /engine/reference/commandline/image_build/#tag
491492
deprecated: false
492493
hidden: false
493494
experimental: false
@@ -497,7 +498,7 @@ options:
497498
- option: target
498499
value_type: string
499500
description: Set the target build stage to build
500-
details_url: /engine/reference/commandline/build/#target
501+
details_url: /engine/reference/commandline/image_build/#target
501502
deprecated: false
502503
hidden: false
503504
experimental: false
@@ -622,7 +623,7 @@ examples: |-
622623
623624
### Set build-time variables (--build-arg) {#build-arg}
624625
625-
Same as [`docker build` command](/engine/reference/commandline/build/#build-arg).
626+
Same as [`docker build` command](/engine/reference/commandline/image_build/#build-arg).
626627
627628
There are also useful built-in build arguments, such as:
628629
@@ -799,6 +800,61 @@ examples: |-
799800
}
800801
```
801802
803+
### Ignore build cache for specific stages (--no-cache-filter) {#no-cache-filter}
804+
805+
The `--no-cache-filter` lets you specify one or more stages of a multi-stage
806+
Dockerfile for which build cache should be ignored. To specify multiple stages,
807+
use a comma-separated syntax:
808+
809+
```console
810+
$ docker buildx build --no-cache-filter stage1,stage2,stage3 .
811+
```
812+
813+
For example, the following Dockerfile contains four stages:
814+
815+
- `base`
816+
- `install`
817+
- `test`
818+
- `release`
819+
820+
```dockerfile
821+
# syntax=docker/dockerfile:1
822+
823+
FROM oven/bun:1 as base
824+
WORKDIR /app
825+
826+
FROM base AS install
827+
WORKDIR /temp/dev
828+
RUN --mount=type=bind,source=package.json,target=package.json \
829+
--mount=type=bind,source=bun.lockb,target=bun.lockb \
830+
bun install --frozen-lockfile
831+
832+
FROM base AS test
833+
COPY --from=install /temp/dev/node_modules node_modules
834+
COPY . .
835+
RUN bun test
836+
837+
FROM base AS release
838+
ENV NODE_ENV=production
839+
COPY --from=install /temp/dev/node_modules node_modules
840+
COPY . .
841+
ENTRYPOINT ["bun", "run", "index.js"]
842+
```
843+
844+
To ignore the cache for the `install` stage:
845+
846+
```console
847+
$ docker buildx build --no-cache-filter install .
848+
```
849+
850+
To ignore the cache the `install` and `release` stages:
851+
852+
```console
853+
$ docker buildx build --no-cache-filter install,release .
854+
```
855+
856+
The arguments for the `--no-cache-filter` flag must be names of stages.
857+
802858
### Set the export action for the build result (-o, --output) {#output}
803859
804860
```text

data/buildx/docker_buildx_debug_build.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ options:
1010
value_type: stringSlice
1111
default_value: '[]'
1212
description: 'Add a custom host-to-IP mapping (format: `host:ip`)'
13-
details_url: /engine/reference/commandline/build/#add-host
13+
details_url: /engine/reference/commandline/image_build/#add-host
1414
deprecated: false
1515
hidden: false
1616
experimental: false
@@ -93,7 +93,7 @@ options:
9393
- option: cgroup-parent
9494
value_type: string
9595
description: Set the parent cgroup for the `RUN` instructions during build
96-
details_url: /engine/reference/commandline/build/#cgroup-parent
96+
details_url: /engine/reference/commandline/image_build/#cgroup-parent
9797
deprecated: false
9898
hidden: false
9999
experimental: false
@@ -173,7 +173,7 @@ options:
173173
shorthand: f
174174
value_type: string
175175
description: 'Name of the Dockerfile (default: `PATH/Dockerfile`)'
176-
details_url: /engine/reference/commandline/build/#file
176+
details_url: /engine/reference/commandline/image_build/#file
177177
deprecated: false
178178
hidden: false
179179
experimental: false
@@ -463,7 +463,7 @@ options:
463463
value_type: stringArray
464464
default_value: '[]'
465465
description: 'Name and optionally a tag (format: `name:tag`)'
466-
details_url: /engine/reference/commandline/build/#tag
466+
details_url: /engine/reference/commandline/image_build/#tag
467467
deprecated: false
468468
hidden: false
469469
experimental: false
@@ -473,7 +473,7 @@ options:
473473
- option: target
474474
value_type: string
475475
description: Set the target build stage to build
476-
details_url: /engine/reference/commandline/build/#target
476+
details_url: /engine/reference/commandline/image_build/#target
477477
deprecated: false
478478
hidden: false
479479
experimental: false

data/buildx/docker_buildx_du.yaml

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ options:
1818
value_type: bool
1919
default_value: "false"
2020
description: Provide a more verbose output
21+
details_url: '#verbose'
2122
deprecated: false
2223
hidden: false
2324
experimental: false
@@ -36,9 +37,102 @@ inherited_options:
3637
kubernetes: false
3738
swarm: false
3839
examples: |-
40+
### Show disk usage
41+
42+
The `docker buildx du` command shows the disk usage for the currently selected
43+
builder.
44+
45+
```console
46+
$ docker buildx du
47+
ID RECLAIMABLE SIZE LAST ACCESSED
48+
12wgll9os87pazzft8lt0yztp* true 1.704GB 13 days ago
49+
iupsv3it5ubh92aweb7c1wojc* true 1.297GB 36 minutes ago
50+
ek4ve8h4obyv5kld6vicmtqyn true 811.7MB 13 days ago
51+
isovrfnmkelzhtdx942w9vjcb* true 811.7MB 13 days ago
52+
0jty7mjrndi1yo7xkv1baralh true 810.5MB 13 days ago
53+
jyzkefmsysqiaakgwmjgxjpcz* true 810.5MB 13 days ago
54+
z8w1y95jn93gvj92jtaj6uhwk true 318MB 2 weeks ago
55+
rz2zgfcwlfxsxd7d41w2sz2tt true 8.224kB* 43 hours ago
56+
n5bkzpewmk2eiu6hn9tzx18jd true 8.224kB* 43 hours ago
57+
ao94g6vtbzdl6k5zgdmrmnwpt true 8.224kB* 43 hours ago
58+
2pyjep7njm0wh39vcingxb97i true 8.224kB* 43 hours ago
59+
Shared: 115.5MB
60+
Private: 10.25GB
61+
Reclaimable: 10.36GB
62+
Total: 10.36GB
63+
```
64+
65+
If `RECLAIMABLE` is false, the `docker buildx du prune` command won't delete
66+
the record, even if you use `--all`. That's because the record is actively in
67+
use by some component of the builder.
68+
69+
The asterisks (\*) in the default output indicate the following:
70+
71+
- An asterisk next to an ID (`zu7m6evdpebh5h8kfkpw9dlf2*`) indicates that the record
72+
is mutable. The size of the record may change, or another build can take ownership of
73+
it and change or commit to it. If you run the `du` command again, this item may
74+
not be there anymore, or the size might be different.
75+
- An asterisk next to a size (`8.288kB*`) indicates that the record is shared.
76+
Storage of the record is shared with some other resource, typically an image.
77+
If you prune such a record then you will lose build cache but only metadata
78+
will be deleted as the image still needs to actual storage layers.
79+
80+
### Use verbose output (--verbose) {#verbose}
81+
82+
The verbose output of the `docker buildx du` command is useful for inspecting
83+
the disk usage records in more detail. The verbose output shows the mutable and
84+
shared states more clearly, as well as additional information about the
85+
corresponding layer.
86+
87+
```console
88+
$ docker buildx du --verbose
89+
...
90+
Last used: 2 days ago
91+
Type: regular
92+
93+
ID: 05d0elirb4mmvpmnzbrp3ssrg
94+
Parent: e8sfdn4mygrg7msi9ak1dy6op
95+
Created at: 2023-11-20 09:53:30.881558721 +0000 UTC
96+
Mutable: false
97+
Reclaimable: true
98+
Shared: false
99+
Size: 0B
100+
Description: [gobase 3/3] WORKDIR /src
101+
Usage count: 3
102+
Last used: 24 hours ago
103+
Type: regular
104+
105+
Reclaimable: 4.453GB
106+
Total: 4.453GB
107+
```
108+
39109
### Override the configured builder instance (--builder) {#builder}
40110
41-
Same as [`buildx --builder`](buildx.md#builder).
111+
Use the `--builder` flag to inspect the disk usage of a particular builder.
112+
113+
```console
114+
$ docker buildx du --builder youthful_shtern
115+
ID RECLAIMABLE SIZE LAST ACCESSED
116+
g41agepgdczekxg2mtw0dujsv* true 1.312GB 47 hours ago
117+
e6ycrsa0bn9akigqgzu0sc6kr true 318MB 47 hours ago
118+
our9zg4ndly65ze1ccczdksiz true 204.9MB 45 hours ago
119+
b7xv3xpxnwupc81tc9ya3mgq6* true 120.6MB 47 hours ago
120+
zihgye15ss6vum3wmck9egdoy* true 79.81MB 2 days ago
121+
aaydharssv1ug98yhuwclkfrh* true 79.81MB 2 days ago
122+
ta1r4vmnjug5dhub76as4kkol* true 74.51MB 47 hours ago
123+
murma9f83j9h8miifbq68udjf* true 74.51MB 47 hours ago
124+
47f961866a49g5y8myz80ixw1* true 74.51MB 47 hours ago
125+
tzh99xtzlaf6txllh3cobag8t true 74.49MB 47 hours ago
126+
ld6laoeuo1kwapysu6afwqybl* true 59.89MB 47 hours ago
127+
yitxizi5kaplpyomqpos2cryp* true 59.83MB 47 hours ago
128+
iy8aa4b7qjn0qmy9wiga9cj8w true 33.65MB 47 hours ago
129+
mci7okeijyp8aqqk16j80dy09 true 19.86MB 47 hours ago
130+
lqvj091he652slxdla4wom3pz true 14.08MB 47 hours ago
131+
fkt31oiv793nd26h42llsjcw7* true 11.87MB 2 days ago
132+
uj802yxtvkcjysnjb4kgwvn2v true 11.68MB 45 hours ago
133+
Reclaimable: 2.627GB
134+
Total: 2.627GB
135+
```
42136
deprecated: false
43137
hidden: false
44138
experimental: false

data/buildx/docker_buildx_ls.yaml

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
command: docker buildx ls
22
short: List builder instances
33
long: |-
4-
Lists all builder instances and the nodes for each instance
4+
Lists all builder instances and the nodes for each instance.
55
66
```console
77
$ docker buildx ls
8-
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
9-
elated_tesla * docker-container
10-
elated_tesla0 unix:///var/run/docker.sock running v0.10.3 linux/amd64
11-
elated_tesla1 ssh://[email protected] running v0.10.3 linux/arm64*, linux/arm/v7, linux/arm/v6
12-
default docker
13-
default default running v0.8.2 linux/amd64
8+
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
9+
elated_tesla* docker-container
10+
\_ elated_tesla0 \_ unix:///var/run/docker.sock running v0.10.3 linux/amd64
11+
\_ elated_tesla1 \_ ssh://[email protected] running v0.10.3 linux/arm64*, linux/arm/v7, linux/arm/v6
12+
default docker
13+
\_ default \_ default running v0.8.2 linux/amd64
1414
```
1515
1616
Each builder has one or more nodes associated with it. The current builder's
@@ -28,6 +28,64 @@ options:
2828
experimentalcli: false
2929
kubernetes: false
3030
swarm: false
31+
- option: format
32+
value_type: string
33+
default_value: table
34+
description: Format the output
35+
details_url: '#format'
36+
deprecated: false
37+
hidden: false
38+
experimental: false
39+
experimentalcli: false
40+
kubernetes: false
41+
swarm: false
42+
examples: |-
43+
### Format the output (--format) {#format}
44+
45+
The formatting options (`--format`) pretty-prints builder instances output
46+
using a Go template.
47+
48+
Valid placeholders for the Go template are listed below:
49+
50+
| Placeholder | Description |
51+
|-------------------|---------------------------------------------|
52+
| `.Name` | Builder or node name |
53+
| `.DriverEndpoint` | Driver (for builder) or Endpoint (for node) |
54+
| `.LastActivity` | Builder last activity |
55+
| `.Status` | Builder or node status |
56+
| `.Buildkit` | BuildKit version of the node |
57+
| `.Platforms` | Available node's platforms |
58+
| `.Error` | Error |
59+
| `.Builder` | Builder object |
60+
61+
When using the `--format` option, the `ls` command will either output the data
62+
exactly as the template declares or, when using the `table` directive, includes
63+
column headers as well.
64+
65+
The following example uses a template without headers and outputs the
66+
`Name` and `DriverEndpoint` entries separated by a colon (`:`):
67+
68+
```console
69+
$ docker buildx ls --format "{{.Name}}: {{.DriverEndpoint}}"
70+
elated_tesla: docker-container
71+
elated_tesla0: unix:///var/run/docker.sock
72+
elated_tesla1: ssh://[email protected]
73+
default: docker
74+
default: default
75+
```
76+
77+
The `Builder` placeholder can be used to access the builder object and its
78+
fields. For example, the following template outputs the builder's and
79+
nodes' names with their respective endpoints:
80+
81+
```console
82+
$ docker buildx ls --format "{{.Builder.Name}}: {{range .Builder.Nodes}}\n {{.Name}}: {{.Endpoint}}{{end}}"
83+
elated_tesla:
84+
elated_tesla0: unix:///var/run/docker.sock
85+
elated_tesla1: ssh://[email protected]
86+
default: docker
87+
default: default
88+
```
3189
deprecated: false
3290
hidden: false
3391
experimental: false

data/buildx/docker_buildx_rm.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
command: docker buildx rm
2-
short: Remove a builder instance
2+
short: Remove one or more builder instances
33
long: |-
44
Removes the specified or current builder. It is a no-op attempting to remove the
55
default builder.
6-
usage: docker buildx rm [NAME]
6+
usage: docker buildx rm [OPTIONS] [NAME] [NAME...]
77
pname: docker buildx
88
plink: docker_buildx.yaml
99
options:

0 commit comments

Comments
 (0)