docs: standardize format for usage

Use the usage output of `--help` for each subcommand, to make
sure all flags/options are included on the page, and to make
it easier to keep docs in sync.

Note that the usage output is only used when reading these
docs on GitHub; docs.docker.com only consumes the "description"
and "example" sections (when present), and generates flag information
and usage output from source

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-01-13 15:31:05 +01:00
parent ff749d8863
commit 1a8af33ff6
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
10 changed files with 141 additions and 69 deletions

View File

@ -1,22 +1,24 @@
# `buildx bake [OPTIONS] [TARGET...]` # buildx bake
Bake is a high-level build command. ```
Usage: docker buildx bake [OPTIONS] [TARGET...]
Each specified target will run in parallel as part of the build. Build from a file
Aliases:
bake, f
Options: Options:
--builder string Override the configured builder instance
| Flag | Description | -f, --file stringArray Build definition file
| --- | --- | --load Shorthand for --set=*.output=type=docker
| -f, --file stringArray | Build definition file --no-cache Do not use cache when building the image
| --load | Shorthand for --set=*.output=type=docker --print Print the options without building
| --no-cache | Do not use cache when building the image --progress string Set type of progress output (auto, plain, tty). Use plain to show container output (default "auto")
| --print | Print the options without building --pull Always attempt to pull a newer version of the image
| --progress string | Set type of progress output (auto, plain, tty). Use plain to show container output (default "auto") --push Shorthand for --set=*.output=type=registry
| --pull | Always attempt to pull a newer version of the image --set stringArray Override target value (eg: targetpattern.key=value)
| --push | Shorthand for --set=*.output=type=registry ```
| --set stringArray | Override target value (eg: targetpattern.key=value)
## Description ## Description

View File

@ -1,32 +1,36 @@
# `buildx build [OPTIONS] PATH | URL | -` # buildx build
The `buildx build` command starts a build using BuildKit. This command is similar ```
to the UI of `docker build` command and takes the same flags and arguments. Usage: docker buildx build [OPTIONS] PATH | URL | -
Start a build
Aliases:
build, b
Options: Options:
--add-host strings Add a custom host-to-IP mapping (host:ip)
| Flag | Description | --allow strings Allow extra privileged entitlement, e.g. network.host, security.insecure
| --- | --- | --build-arg stringArray Set build-time variables
| --add-host [] | Add a custom host-to-IP mapping (host:ip) --builder string Override the configured builder instance
| --allow [] | Allow extra privileged entitlement, e.g. network.host, security.insecure --cache-from stringArray External cache sources (eg. user/app:cache, type=local,src=path/to/dir)
| --build-arg [] | Set build-time variables --cache-to stringArray Cache export destinations (eg. user/app:cache, type=local,dest=path/to/dir)
| --cache-from [] | External cache sources (eg. user/app:cache, type=local,src=path/to/dir) -f, --file string Name of the Dockerfile (Default is 'PATH/Dockerfile')
| --cache-to [] | Cache export destinations (eg. user/app:cache, type=local,dest=path/to/dir) --iidfile string Write the image ID to the file
| --file string | Name of the Dockerfile (Default is 'PATH/Dockerfile') --label stringArray Set metadata for an image
| --iidfile string | Write the image ID to the file --load Shorthand for --output=type=docker
| --label [] | Set metadata for an image --network string Set the networking mode for the RUN instructions during build (default "default")
| --load | Shorthand for --output=type=docker --no-cache Do not use cache when building the image
| --network string | Set the networking mode for the RUN instructions during build (default "default") -o, --output stringArray Output destination (format: type=local,dest=path)
| --no-cache | Do not use cache when building the image --platform stringArray Set target platform for build
| --output [] | Output destination (format: type=local,dest=path) --progress string Set type of progress output (auto, plain, tty). Use plain to show container output (default "auto")
| --platform [] | Set target platform for build --pull Always attempt to pull a newer version of the image
| --progress string | Set type of progress output (auto, plain, tty). Use plain to show container output (default "auto") --push Shorthand for --output=type=registry
| --pull | Always attempt to pull a newer version of the image --secret stringArray Secret file to expose to the build: id=mysecret,src=/local/secret
| --push | Shorthand for --output=type=registry --ssh stringArray SSH agent socket or keys to expose to the build (format: default|<id>[=<socket>|<key>[,<key>]])
| --secret [] | Secret file to expose to the build: id=mysecret,src=/local/secret -t, --tag stringArray Name and optionally a tag in the 'name:tag' format
| --ssh [] | SSH agent socket or keys to expose to the build (format: default\|&#60;id&#62;[=&#60;socket&#62;\|&#60;key&#62;[,&#60;key&#62;]]) --target string Set the target build stage to build.
| --tag [] | Name and optionally a tag in the 'name:tag' format ```
| --target string | Set the target build stage to build.
## Description ## Description

View File

@ -1,19 +1,23 @@
# `buildx create [OPTIONS] [CONTEXT|ENDPOINT]` # buildx create
```
Usage: docker buildx create [OPTIONS] [CONTEXT|ENDPOINT]
Create a new builder instance
Options: Options:
--append Append a node to builder instead of changing it
| Flag | Description | --builder string Override the configured builder instance
| --- | --- | --buildkitd-flags string Flags for buildkitd daemon
| --append | Append a node to builder instead of changing it --config string BuildKit config file
| --buildkitd-flags string | Flags for buildkitd daemon --driver string Driver to use (available: [docker docker-container kubernetes])
| --config string | BuildKit config file --driver-opt stringArray Options for the driver
| --driver string | Driver to use (eg. docker-container) --leave Remove a node from builder instead of changing it
| --driver-opt stringArray | Options for the driver --name string Builder instance name
| --leave | Remove a node from builder instead of changing it --node string Create/modify node with given name
| --name string | Builder instance name --platform stringArray Fixed platforms for current node
| --node string | Create/modify node with given name --use Set the current builder instance
| --platform stringArray | Fixed platforms for current node ```
| --use | Set the current builder instance
## Description ## Description

View File

@ -1,13 +1,17 @@
# `buildx imagetools create [OPTIONS] [SOURCE] [SOURCE...]` # buildx imagetools create
```
Usage: docker buildx imagetools create [OPTIONS] [SOURCE] [SOURCE...]
Create a new image based on source images
Options: Options:
--append Append to existing manifest
| Flag | Description | --builder string Override the configured builder instance
| --- | --- | --dry-run Show final image instead of pushing
| --append | Append to existing manifest -f, --file stringArray Read source descriptor from file
| --dry-run | Show final image instead of pushing -t, --tag stringArray Set reference for new image
| -f, --file stringArray | Read source descriptor from file ```
| -t, --tag stringArray | Set reference for new image
## Description ## Description

View File

@ -1,4 +1,14 @@
# `buildx imagetools inspect NAME` # buildx imagetools inspect
```
Usage: docker buildx imagetools inspect [OPTIONS] NAME
Show details of image in the registry
Options:
--builder string Override the configured builder instance
--raw Show original JSON manifest
```
## Description ## Description

View File

@ -1,4 +1,14 @@
# `buildx inspect [NAME]` # buildx inspect
```
Usage: docker buildx inspect [NAME]
Inspect current builder instance
Options:
--bootstrap Ensure builder has booted before inspecting
--builder string Override the configured builder instance
```
## Description ## Description

View File

@ -1,4 +1,13 @@
# `buildx ls` # buildx ls
```
Usage: docker buildx ls
List builder instances
Options:
--builder string Override the configured builder instance
```
## Description ## Description

View File

@ -1,4 +1,13 @@
# `buildx rm [NAME]` # buildx rm
```
Usage: docker buildx rm [NAME]
Remove a builder instance
Options:
--builder string Override the configured builder instance
```
## Description ## Description

View File

@ -1,4 +1,13 @@
# `buildx stop [NAME]` # buildx stop
```
Usage: docker buildx stop [NAME]
Stop builder instance
Options:
--builder string Override the configured builder instance
```
## Description ## Description

View File

@ -1,4 +1,15 @@
# `buildx use NAME` # buildx use
```
Usage: docker buildx use [OPTIONS] NAME
Set the current builder instance
Options:
--builder string Override the configured builder instance
--default Set builder as default for current context
--global Builder persists context changes
```
## Description ## Description