Skip to content

Commit 262a771

Browse files
committed
Update reference docs
```sh for cmd in build create run update; do doc="docs/reference/commandline/$cmd.md" tmp="$(mktemp)" awk -v cmd="$cmd" ' # Replace the contents of the first markdown block # with output from docker help (omitting leading blank lines). /^```markdown/ && !replaced { # Print the block start. print; # Insert `docker help` output. while(("./build/docker help " cmd | getline)>0) { if(NF>0) trimmed=1; if(trimmed) print; } # Advance to the block end. while(getline>0 && $0!="```"); replaced++; } { print } ' "$doc" >"$tmp" && \ mv "$tmp" "$doc" done ``` Signed-off-by: Richard Gibson <richard.gibson@gmail.com>
1 parent 4b32883 commit 262a771

4 files changed

Lines changed: 37 additions & 48 deletions

File tree

docs/reference/commandline/build.md

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Usage: docker build [OPTIONS] PATH | URL | -
1212
Build an image from a Dockerfile
1313

1414
Options:
15-
--add-host value Add a custom host-to-IP mapping (host:ip) (default [])
16-
--build-arg value Set build-time variables (default [])
17-
--cache-from value Images to consider as cache sources (default [])
15+
--add-host list Add a custom host-to-IP mapping (host:ip)
16+
--build-arg list Set build-time variables
17+
--cache-from strings Images to consider as cache sources
1818
--cgroup-parent string Optional parent cgroup for the container
1919
--compress Compress the build context using gzip
2020
--cpu-period int Limit the CPU CFS (Completely Fair Scheduler) period
@@ -23,38 +23,26 @@ Options:
2323
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
2424
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
2525
--disable-content-trust Skip image verification (default true)
26-
-f, --file string Name of the Dockerfile (Default is 'PATH/Dockerfile')
26+
-f, --file string Name of the Dockerfile (Default is "PATH/Dockerfile")
2727
--force-rm Always remove intermediate containers
28-
--help Print usage
2928
--iidfile string Write the image ID to the file
3029
--isolation string Container isolation technology
31-
--label value Set metadata for an image (default [])
32-
-m, --memory string Memory limit
33-
--memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap
30+
--label list Set metadata for an image
31+
-m, --memory bytes Memory limit
32+
--memory-swap bytes Swap limit equal to memory plus swap: -1 to enable unlimited swap
3433
--network string Set the networking mode for the RUN instructions during build
35-
'bridge': use default Docker bridge
36-
'none': no networking
37-
'container:<name|id>': reuse another container's network stack
38-
'host': use the Docker host network stack
39-
'<network-name>|<network-id>': connect to a user-defined network
34+
(default "default")
4035
--no-cache Do not use cache when building the image
41-
-o, --output Output destination (format: type=local,dest=path)
36+
--platform string Set platform if server is multi-platform capable
4237
--pull Always attempt to pull a newer version of the image
43-
--progress Set type of progress output (only if BuildKit enabled) (auto, plain, tty).
44-
Use plain to show container output
4538
-q, --quiet Suppress the build output and print image ID on success
46-
--rm Remove intermediate containers after a successful build (default true)
47-
--secret Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret"
48-
--security-opt value Security Options (default [])
39+
--rm Remove intermediate containers after a successful build
40+
(default true)
41+
--security-opt strings Security options
4942
--shm-size bytes Size of /dev/shm
50-
The format is `<number><unit>`. `number` must be greater than `0`.
51-
Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes),
52-
or `g` (gigabytes). If you omit the unit, the system uses bytes.
53-
--squash Squash newly built layers into a single new layer (**Experimental Only**)
54-
--ssh SSH agent socket or keys to expose to the build (only if BuildKit enabled) (format: default|<id>[=<socket>|<key>[,<key>]])
55-
-t, --tag value Name and optionally a tag in the 'name:tag' format (default [])
43+
-t, --tag list Name and optionally a tag in the "name:tag" format
5644
--target string Set the target build stage to build.
57-
--ulimit value Ulimit options (default [])
45+
--ulimit ulimit Ulimit options (default [])
5846
```
5947

6048
## Description

docs/reference/commandline/create.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Options:
4848
-e, --env list Set environment variables
4949
--env-file list Read in a file of environment variables
5050
--expose list Expose a port or a range of ports
51-
--gpus gpu-request GPU devices to add to the container ('all' to pass all
51+
--gpus gpu-request GPU devices to add to the container ("all" to pass all
5252
GPUs)
5353
--group-add list Add additional groups to join
5454
--health-cmd string Command to run to check health
@@ -77,7 +77,7 @@ Options:
7777
--mac-address string Container MAC address (e.g., 92:d0:c6:0a:29:33)
7878
-m, --memory bytes Memory limit
7979
--memory-reservation bytes Memory soft limit
80-
--memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable
80+
--memory-swap bytes Swap limit equal to memory plus swap: -1 to enable
8181
unlimited swap
8282
--memory-swappiness int Tune container memory swappiness (0 to 100) (default -1)
8383
--mount mount Attach a filesystem mount to the container (e.g.,
@@ -101,7 +101,7 @@ Options:
101101
("always"|"missing"|"never") (default "missing")
102102
--read-only Mount the container's root filesystem as read only
103103
--restart string Restart policy to apply when a container exits
104-
(default "no")
104+
("no"|"on-failure[:max-retry]"|"always"|"unless-stopped") (default "no")
105105
--rm Automatically remove the container when it exits
106106
--runtime string Runtime to use for this container
107107
--security-opt list Security Options

docs/reference/commandline/run.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Options:
4848
-e, --env list Set environment variables
4949
--env-file list Read in a file of environment variables
5050
--expose list Expose a port or a range of ports
51-
--gpus gpu-request GPU devices to add to the container ('all' to pass all
51+
--gpus gpu-request GPU devices to add to the container ("all" to pass all
5252
GPUs)
5353
--group-add list Add additional groups to join
5454
--health-cmd string Command to run to check health
@@ -77,7 +77,7 @@ Options:
7777
--mac-address string Container MAC address (e.g., 92:d0:c6:0a:29:33)
7878
-m, --memory bytes Memory limit
7979
--memory-reservation bytes Memory soft limit
80-
--memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable
80+
--memory-swap bytes Swap limit equal to memory plus swap: -1 to enable
8181
unlimited swap
8282
--memory-swappiness int Tune container memory swappiness (0 to 100) (default -1)
8383
--mount mount Attach a filesystem mount to the container (e.g.,
@@ -101,7 +101,7 @@ Options:
101101
(default "missing")
102102
--read-only Mount the container's root filesystem as read only
103103
--restart string Restart policy to apply when a container exits
104-
(default "no")
104+
("no"|"on-failure[:max-retry]"|"always"|"unless-stopped") (default "no")
105105
--rm Automatically remove the container when it exits
106106
--runtime string Runtime to use for this container
107107
--security-opt list Security Options

docs/reference/commandline/update.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@ Usage: docker update [OPTIONS] CONTAINER [CONTAINER...]
1212
Update configuration of one or more containers
1313

1414
Options:
15-
--blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
16-
--cpu-period int Limit CPU CFS (Completely Fair Scheduler) period
17-
--cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota
18-
--cpu-rt-period int Limit the CPU real-time period in microseconds
19-
--cpu-rt-runtime int Limit the CPU real-time runtime in microseconds
20-
-c, --cpu-shares int CPU shares (relative weight)
21-
--cpus decimal Number of CPUs (default 0.000)
22-
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
23-
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
24-
--help Print usage
25-
--kernel-memory string Kernel memory limit
26-
-m, --memory string Memory limit
27-
--memory-reservation string Memory soft limit
28-
--memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap
29-
--pids-limit int Tune container pids limit (set -1 for unlimited)
30-
--restart string Restart policy to apply when a container exits
15+
--blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to
16+
disable (default 0)
17+
--cpu-period int Limit CPU CFS (Completely Fair Scheduler) period
18+
--cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota
19+
--cpu-rt-period int Limit the CPU real-time period in microseconds
20+
--cpu-rt-runtime int Limit the CPU real-time runtime in microseconds
21+
-c, --cpu-shares int CPU shares (relative weight)
22+
--cpus decimal Number of CPUs
23+
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
24+
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
25+
--kernel-memory bytes Kernel memory limit
26+
-m, --memory bytes Memory limit
27+
--memory-reservation bytes Memory soft limit
28+
--memory-swap bytes Swap limit equal to memory plus swap: -1 to enable
29+
unlimited swap
30+
--pids-limit int Tune container pids limit (set -1 for unlimited)
31+
--restart string Restart policy to apply when a container exits
3132
```
3233

3334
## Description

0 commit comments

Comments
 (0)