mirror of https://github.com/docker/docs.git
build: regen buildx cli 68c3ac4
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
368f2f232c
commit
385526269a
|
@ -6,7 +6,7 @@ long: |-
|
|||
to the UI of `docker build` command and takes the same flags and arguments.
|
||||
|
||||
For documentation on most of these flags, refer to the [`docker build`
|
||||
documentation](/engine/reference/commandline/build/).
|
||||
documentation](/engine/reference/commandline/image_build/).
|
||||
This page describes a subset of the new flags.
|
||||
usage: docker buildx build [OPTIONS] PATH | URL | -
|
||||
pname: docker buildx
|
||||
|
@ -16,7 +16,7 @@ options:
|
|||
value_type: stringSlice
|
||||
default_value: '[]'
|
||||
description: 'Add a custom host-to-IP mapping (format: `host:ip`)'
|
||||
details_url: /engine/reference/commandline/build/#add-host
|
||||
details_url: /engine/reference/commandline/image_build/#add-host
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
@ -106,7 +106,7 @@ options:
|
|||
- option: cgroup-parent
|
||||
value_type: string
|
||||
description: Set the parent cgroup for the `RUN` instructions during build
|
||||
details_url: /engine/reference/commandline/build/#cgroup-parent
|
||||
details_url: /engine/reference/commandline/image_build/#cgroup-parent
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
@ -186,7 +186,7 @@ options:
|
|||
shorthand: f
|
||||
value_type: string
|
||||
description: 'Name of the Dockerfile (default: `PATH/Dockerfile`)'
|
||||
details_url: /engine/reference/commandline/build/#file
|
||||
details_url: /engine/reference/commandline/image_build/#file
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
@ -296,6 +296,7 @@ options:
|
|||
value_type: stringArray
|
||||
default_value: '[]'
|
||||
description: Do not cache specified stages
|
||||
details_url: '#no-cache-filter'
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
@ -487,7 +488,7 @@ options:
|
|||
value_type: stringArray
|
||||
default_value: '[]'
|
||||
description: 'Name and optionally a tag (format: `name:tag`)'
|
||||
details_url: /engine/reference/commandline/build/#tag
|
||||
details_url: /engine/reference/commandline/image_build/#tag
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
@ -497,7 +498,7 @@ options:
|
|||
- option: target
|
||||
value_type: string
|
||||
description: Set the target build stage to build
|
||||
details_url: /engine/reference/commandline/build/#target
|
||||
details_url: /engine/reference/commandline/image_build/#target
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
@ -622,7 +623,7 @@ examples: |-
|
|||
|
||||
### Set build-time variables (--build-arg) {#build-arg}
|
||||
|
||||
Same as [`docker build` command](/engine/reference/commandline/build/#build-arg).
|
||||
Same as [`docker build` command](/engine/reference/commandline/image_build/#build-arg).
|
||||
|
||||
There are also useful built-in build arguments, such as:
|
||||
|
||||
|
@ -799,6 +800,61 @@ examples: |-
|
|||
}
|
||||
```
|
||||
|
||||
### Ignore build cache for specific stages (--no-cache-filter) {#no-cache-filter}
|
||||
|
||||
The `--no-cache-filter` lets you specify one or more stages of a multi-stage
|
||||
Dockerfile for which build cache should be ignored. To specify multiple stages,
|
||||
use a comma-separated syntax:
|
||||
|
||||
```console
|
||||
$ docker buildx build --no-cache-filter stage1,stage2,stage3 .
|
||||
```
|
||||
|
||||
For example, the following Dockerfile contains four stages:
|
||||
|
||||
- `base`
|
||||
- `install`
|
||||
- `test`
|
||||
- `release`
|
||||
|
||||
```dockerfile
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM oven/bun:1 as base
|
||||
WORKDIR /app
|
||||
|
||||
FROM base AS install
|
||||
WORKDIR /temp/dev
|
||||
RUN --mount=type=bind,source=package.json,target=package.json \
|
||||
--mount=type=bind,source=bun.lockb,target=bun.lockb \
|
||||
bun install --frozen-lockfile
|
||||
|
||||
FROM base AS test
|
||||
COPY --from=install /temp/dev/node_modules node_modules
|
||||
COPY . .
|
||||
RUN bun test
|
||||
|
||||
FROM base AS release
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=install /temp/dev/node_modules node_modules
|
||||
COPY . .
|
||||
ENTRYPOINT ["bun", "run", "index.js"]
|
||||
```
|
||||
|
||||
To ignore the cache for the `install` stage:
|
||||
|
||||
```console
|
||||
$ docker buildx build --no-cache-filter install .
|
||||
```
|
||||
|
||||
To ignore the cache the `install` and `release` stages:
|
||||
|
||||
```console
|
||||
$ docker buildx build --no-cache-filter install,release .
|
||||
```
|
||||
|
||||
The arguments for the `--no-cache-filter` flag must be names of stages.
|
||||
|
||||
### Set the export action for the build result (-o, --output) {#output}
|
||||
|
||||
```text
|
||||
|
|
|
@ -10,7 +10,7 @@ options:
|
|||
value_type: stringSlice
|
||||
default_value: '[]'
|
||||
description: 'Add a custom host-to-IP mapping (format: `host:ip`)'
|
||||
details_url: /engine/reference/commandline/build/#add-host
|
||||
details_url: /engine/reference/commandline/image_build/#add-host
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
@ -93,7 +93,7 @@ options:
|
|||
- option: cgroup-parent
|
||||
value_type: string
|
||||
description: Set the parent cgroup for the `RUN` instructions during build
|
||||
details_url: /engine/reference/commandline/build/#cgroup-parent
|
||||
details_url: /engine/reference/commandline/image_build/#cgroup-parent
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
@ -173,7 +173,7 @@ options:
|
|||
shorthand: f
|
||||
value_type: string
|
||||
description: 'Name of the Dockerfile (default: `PATH/Dockerfile`)'
|
||||
details_url: /engine/reference/commandline/build/#file
|
||||
details_url: /engine/reference/commandline/image_build/#file
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
@ -463,7 +463,7 @@ options:
|
|||
value_type: stringArray
|
||||
default_value: '[]'
|
||||
description: 'Name and optionally a tag (format: `name:tag`)'
|
||||
details_url: /engine/reference/commandline/build/#tag
|
||||
details_url: /engine/reference/commandline/image_build/#tag
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
@ -473,7 +473,7 @@ options:
|
|||
- option: target
|
||||
value_type: string
|
||||
description: Set the target build stage to build
|
||||
details_url: /engine/reference/commandline/build/#target
|
||||
details_url: /engine/reference/commandline/image_build/#target
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
|
|
@ -18,6 +18,7 @@ options:
|
|||
value_type: bool
|
||||
default_value: "false"
|
||||
description: Provide a more verbose output
|
||||
details_url: '#verbose'
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
@ -36,9 +37,102 @@ inherited_options:
|
|||
kubernetes: false
|
||||
swarm: false
|
||||
examples: |-
|
||||
### Show disk usage
|
||||
|
||||
The `docker buildx du` command shows the disk usage for the currently selected
|
||||
builder.
|
||||
|
||||
```console
|
||||
$ docker buildx du
|
||||
ID RECLAIMABLE SIZE LAST ACCESSED
|
||||
12wgll9os87pazzft8lt0yztp* true 1.704GB 13 days ago
|
||||
iupsv3it5ubh92aweb7c1wojc* true 1.297GB 36 minutes ago
|
||||
ek4ve8h4obyv5kld6vicmtqyn true 811.7MB 13 days ago
|
||||
isovrfnmkelzhtdx942w9vjcb* true 811.7MB 13 days ago
|
||||
0jty7mjrndi1yo7xkv1baralh true 810.5MB 13 days ago
|
||||
jyzkefmsysqiaakgwmjgxjpcz* true 810.5MB 13 days ago
|
||||
z8w1y95jn93gvj92jtaj6uhwk true 318MB 2 weeks ago
|
||||
rz2zgfcwlfxsxd7d41w2sz2tt true 8.224kB* 43 hours ago
|
||||
n5bkzpewmk2eiu6hn9tzx18jd true 8.224kB* 43 hours ago
|
||||
ao94g6vtbzdl6k5zgdmrmnwpt true 8.224kB* 43 hours ago
|
||||
2pyjep7njm0wh39vcingxb97i true 8.224kB* 43 hours ago
|
||||
Shared: 115.5MB
|
||||
Private: 10.25GB
|
||||
Reclaimable: 10.36GB
|
||||
Total: 10.36GB
|
||||
```
|
||||
|
||||
If `RECLAIMABLE` is false, the `docker buildx du prune` command won't delete
|
||||
the record, even if you use `--all`. That's because the record is actively in
|
||||
use by some component of the builder.
|
||||
|
||||
The asterisks (\*) in the default output indicate the following:
|
||||
|
||||
- An asterisk next to an ID (`zu7m6evdpebh5h8kfkpw9dlf2*`) indicates that the record
|
||||
is mutable. The size of the record may change, or another build can take ownership of
|
||||
it and change or commit to it. If you run the `du` command again, this item may
|
||||
not be there anymore, or the size might be different.
|
||||
- An asterisk next to a size (`8.288kB*`) indicates that the record is shared.
|
||||
Storage of the record is shared with some other resource, typically an image.
|
||||
If you prune such a record then you will lose build cache but only metadata
|
||||
will be deleted as the image still needs to actual storage layers.
|
||||
|
||||
### Use verbose output (--verbose) {#verbose}
|
||||
|
||||
The verbose output of the `docker buildx du` command is useful for inspecting
|
||||
the disk usage records in more detail. The verbose output shows the mutable and
|
||||
shared states more clearly, as well as additional information about the
|
||||
corresponding layer.
|
||||
|
||||
```console
|
||||
$ docker buildx du --verbose
|
||||
...
|
||||
Last used: 2 days ago
|
||||
Type: regular
|
||||
|
||||
ID: 05d0elirb4mmvpmnzbrp3ssrg
|
||||
Parent: e8sfdn4mygrg7msi9ak1dy6op
|
||||
Created at: 2023-11-20 09:53:30.881558721 +0000 UTC
|
||||
Mutable: false
|
||||
Reclaimable: true
|
||||
Shared: false
|
||||
Size: 0B
|
||||
Description: [gobase 3/3] WORKDIR /src
|
||||
Usage count: 3
|
||||
Last used: 24 hours ago
|
||||
Type: regular
|
||||
|
||||
Reclaimable: 4.453GB
|
||||
Total: 4.453GB
|
||||
```
|
||||
|
||||
### Override the configured builder instance (--builder) {#builder}
|
||||
|
||||
Same as [`buildx --builder`](buildx.md#builder).
|
||||
Use the `--builder` flag to inspect the disk usage of a particular builder.
|
||||
|
||||
```console
|
||||
$ docker buildx du --builder youthful_shtern
|
||||
ID RECLAIMABLE SIZE LAST ACCESSED
|
||||
g41agepgdczekxg2mtw0dujsv* true 1.312GB 47 hours ago
|
||||
e6ycrsa0bn9akigqgzu0sc6kr true 318MB 47 hours ago
|
||||
our9zg4ndly65ze1ccczdksiz true 204.9MB 45 hours ago
|
||||
b7xv3xpxnwupc81tc9ya3mgq6* true 120.6MB 47 hours ago
|
||||
zihgye15ss6vum3wmck9egdoy* true 79.81MB 2 days ago
|
||||
aaydharssv1ug98yhuwclkfrh* true 79.81MB 2 days ago
|
||||
ta1r4vmnjug5dhub76as4kkol* true 74.51MB 47 hours ago
|
||||
murma9f83j9h8miifbq68udjf* true 74.51MB 47 hours ago
|
||||
47f961866a49g5y8myz80ixw1* true 74.51MB 47 hours ago
|
||||
tzh99xtzlaf6txllh3cobag8t true 74.49MB 47 hours ago
|
||||
ld6laoeuo1kwapysu6afwqybl* true 59.89MB 47 hours ago
|
||||
yitxizi5kaplpyomqpos2cryp* true 59.83MB 47 hours ago
|
||||
iy8aa4b7qjn0qmy9wiga9cj8w true 33.65MB 47 hours ago
|
||||
mci7okeijyp8aqqk16j80dy09 true 19.86MB 47 hours ago
|
||||
lqvj091he652slxdla4wom3pz true 14.08MB 47 hours ago
|
||||
fkt31oiv793nd26h42llsjcw7* true 11.87MB 2 days ago
|
||||
uj802yxtvkcjysnjb4kgwvn2v true 11.68MB 45 hours ago
|
||||
Reclaimable: 2.627GB
|
||||
Total: 2.627GB
|
||||
```
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
command: docker buildx ls
|
||||
short: List builder instances
|
||||
long: |-
|
||||
Lists all builder instances and the nodes for each instance
|
||||
Lists all builder instances and the nodes for each instance.
|
||||
|
||||
```console
|
||||
$ docker buildx ls
|
||||
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
|
||||
elated_tesla * docker-container
|
||||
elated_tesla0 unix:///var/run/docker.sock running v0.10.3 linux/amd64
|
||||
elated_tesla1 ssh://ubuntu@1.2.3.4 running v0.10.3 linux/arm64*, linux/arm/v7, linux/arm/v6
|
||||
default docker
|
||||
default default running v0.8.2 linux/amd64
|
||||
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
|
||||
elated_tesla* docker-container
|
||||
\_ elated_tesla0 \_ unix:///var/run/docker.sock running v0.10.3 linux/amd64
|
||||
\_ elated_tesla1 \_ ssh://ubuntu@1.2.3.4 running v0.10.3 linux/arm64*, linux/arm/v7, linux/arm/v6
|
||||
default docker
|
||||
\_ default \_ default running v0.8.2 linux/amd64
|
||||
```
|
||||
|
||||
Each builder has one or more nodes associated with it. The current builder's
|
||||
|
@ -28,6 +28,64 @@ options:
|
|||
experimentalcli: false
|
||||
kubernetes: false
|
||||
swarm: false
|
||||
- option: format
|
||||
value_type: string
|
||||
default_value: table
|
||||
description: Format the output
|
||||
details_url: '#format'
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
experimentalcli: false
|
||||
kubernetes: false
|
||||
swarm: false
|
||||
examples: |-
|
||||
### Format the output (--format) {#format}
|
||||
|
||||
The formatting options (`--format`) pretty-prints builder instances output
|
||||
using a Go template.
|
||||
|
||||
Valid placeholders for the Go template are listed below:
|
||||
|
||||
| Placeholder | Description |
|
||||
|-------------------|---------------------------------------------|
|
||||
| `.Name` | Builder or node name |
|
||||
| `.DriverEndpoint` | Driver (for builder) or Endpoint (for node) |
|
||||
| `.LastActivity` | Builder last activity |
|
||||
| `.Status` | Builder or node status |
|
||||
| `.Buildkit` | BuildKit version of the node |
|
||||
| `.Platforms` | Available node's platforms |
|
||||
| `.Error` | Error |
|
||||
| `.Builder` | Builder object |
|
||||
|
||||
When using the `--format` option, the `ls` command will either output the data
|
||||
exactly as the template declares or, when using the `table` directive, includes
|
||||
column headers as well.
|
||||
|
||||
The following example uses a template without headers and outputs the
|
||||
`Name` and `DriverEndpoint` entries separated by a colon (`:`):
|
||||
|
||||
```console
|
||||
$ docker buildx ls --format "{{.Name}}: {{.DriverEndpoint}}"
|
||||
elated_tesla: docker-container
|
||||
elated_tesla0: unix:///var/run/docker.sock
|
||||
elated_tesla1: ssh://ubuntu@1.2.3.4
|
||||
default: docker
|
||||
default: default
|
||||
```
|
||||
|
||||
The `Builder` placeholder can be used to access the builder object and its
|
||||
fields. For example, the following template outputs the builder's and
|
||||
nodes' names with their respective endpoints:
|
||||
|
||||
```console
|
||||
$ docker buildx ls --format "{{.Builder.Name}}: {{range .Builder.Nodes}}\n {{.Name}}: {{.Endpoint}}{{end}}"
|
||||
elated_tesla:
|
||||
elated_tesla0: unix:///var/run/docker.sock
|
||||
elated_tesla1: ssh://ubuntu@1.2.3.4
|
||||
default: docker
|
||||
default: default
|
||||
```
|
||||
deprecated: false
|
||||
hidden: false
|
||||
experimental: false
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
command: docker buildx rm
|
||||
short: Remove a builder instance
|
||||
short: Remove one or more builder instances
|
||||
long: |-
|
||||
Removes the specified or current builder. It is a no-op attempting to remove the
|
||||
default builder.
|
||||
usage: docker buildx rm [NAME]
|
||||
usage: docker buildx rm [OPTIONS] [NAME] [NAME...]
|
||||
pname: docker buildx
|
||||
plink: docker_buildx.yaml
|
||||
options:
|
||||
|
|
Loading…
Reference in New Issue