Standardized formatting of CLI reference commands
Command name should be a H1
Only Description, Examples, and Related Commands should be H2
Changed 'Related information' heading to 'Related commands' since 99% it is only linking commands
Added some examples where relevant
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 52df69f00d
)
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
This commit is contained in:
parent
bbbeed1e0c
commit
abfd780ba3
13 changed files with 35 additions and 4 deletions
|
@ -70,6 +70,7 @@ fraction of a second no more than nine digits long.
|
||||||
The following removes containers created more than 5 minutes ago:
|
The following removes containers created more than 5 minutes ago:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
|
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
|
||||||
|
|
||||||
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
|
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
|
||||||
|
@ -87,11 +88,13 @@ $ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}
|
||||||
|
|
||||||
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
|
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
|
||||||
61b9efa71024 busybox "sh" 2017-01-04 13:23:33 -0800 PST Exited (0) 44 seconds ago
|
61b9efa71024 busybox "sh" 2017-01-04 13:23:33 -0800 PST Exited (0) 44 seconds ago
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
The following removes containers created before `2017-01-04T13:10:00`:
|
The following removes containers created before `2017-01-04T13:10:00`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
|
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
|
||||||
|
|
||||||
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
|
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
|
||||||
|
@ -109,6 +112,7 @@ $ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}
|
||||||
|
|
||||||
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
|
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
|
||||||
53a9bc23a516 busybox "sh" 2017-01-04 13:11:59 -0800 PST Exited (0) 9 minutes ago
|
53a9bc23a516 busybox "sh" 2017-01-04 13:11:59 -0800 PST Exited (0) 9 minutes ago
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Related commands
|
## Related commands
|
||||||
|
|
|
@ -323,7 +323,7 @@ pre-configuration of storage. It is strongly recommended that you do
|
||||||
not use loopback in production. Ensure your Engine daemon has a
|
not use loopback in production. Ensure your Engine daemon has a
|
||||||
`--storage-opt dm.thinpooldev` argument provided.
|
`--storage-opt dm.thinpooldev` argument provided.
|
||||||
|
|
||||||
###### Example:
|
###### Example
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo dockerd --storage-opt dm.thinpooldev=/dev/mapper/thin-pool
|
$ sudo dockerd --storage-opt dm.thinpooldev=/dev/mapper/thin-pool
|
||||||
|
@ -341,7 +341,7 @@ The base device size can be increased at daemon restart which will allow
|
||||||
all future images and containers (based on those new images) to be of the
|
all future images and containers (based on those new images) to be of the
|
||||||
new base device size.
|
new base device size.
|
||||||
|
|
||||||
###### Examples
|
###### Example
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo dockerd --storage-opt dm.basesize=50G
|
$ sudo dockerd --storage-opt dm.basesize=50G
|
||||||
|
@ -413,6 +413,7 @@ Specifies extra mkfs arguments to be used when creating the base device.
|
||||||
|
|
||||||
###### Example
|
###### Example
|
||||||
|
|
||||||
|
>>>>>>> 52df69f00... Standardized formatting of CLI reference commands
|
||||||
```bash
|
```bash
|
||||||
$ sudo dockerd --storage-opt "dm.mkfsarg=-O ^has_journal"
|
$ sudo dockerd --storage-opt "dm.mkfsarg=-O ^has_journal"
|
||||||
```
|
```
|
||||||
|
|
|
@ -92,6 +92,7 @@ fraction of a second no more than nine digits long.
|
||||||
The following removes images created before `2017-01-04T00:00:00`:
|
The following removes images created before `2017-01-04T00:00:00`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}'
|
$ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}'
|
||||||
REPOSITORY TAG IMAGE ID CREATED AT SIZE
|
REPOSITORY TAG IMAGE ID CREATED AT SIZE
|
||||||
foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB
|
foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB
|
||||||
|
@ -114,6 +115,7 @@ $ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt
|
||||||
|
|
||||||
REPOSITORY TAG IMAGE ID CREATED AT SIZE
|
REPOSITORY TAG IMAGE ID CREATED AT SIZE
|
||||||
foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB
|
foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
The following removes images created more than 10 days (`240h`) ago:
|
The following removes images created more than 10 days (`240h`) ago:
|
||||||
|
|
|
@ -26,6 +26,7 @@ Options:
|
||||||
The tarball may be compressed with gzip, bzip, or xz
|
The tarball may be compressed with gzip, bzip, or xz
|
||||||
-q, --quiet Suppress the load output but still outputs the imported images
|
-q, --quiet Suppress the load output but still outputs the imported images
|
||||||
```
|
```
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
`docker load` loads a tarred repository from a file or the standard input stream.
|
`docker load` loads a tarred repository from a file or the standard input stream.
|
||||||
|
|
|
@ -148,9 +148,11 @@ $ docker plugin inspect tiborvass/sample-volume-plugin:latest
|
||||||
### Formatting the output
|
### Formatting the output
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker plugin inspect -f '{{.Id}}' tiborvass/sample-volume-plugin:latest
|
$ docker plugin inspect -f '{{.Id}}' tiborvass/sample-volume-plugin:latest
|
||||||
|
|
||||||
8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21
|
8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -101,9 +101,11 @@ The following example uses a template without headers and outputs the
|
||||||
`ID` and `Name` entries separated by a colon for all plugins:
|
`ID` and `Name` entries separated by a colon for all plugins:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker plugin ls --format "{{.ID}}: {{.Name}}"
|
$ docker plugin ls --format "{{.ID}}: {{.Name}}"
|
||||||
|
|
||||||
4be01827a72e: tiborvass/no-remove
|
4be01827a72e: tiborvass/no-remove
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ The following example change the env variable `DEBUG` on the
|
||||||
`sample-volume-plugin` plugin.
|
`sample-volume-plugin` plugin.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
|
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
|
||||||
|
|
||||||
[DEBUG=0]
|
[DEBUG=0]
|
||||||
|
@ -50,6 +51,7 @@ $ docker plugin set tiborvass/sample-volume-plugin DEBUG=1
|
||||||
|
|
||||||
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
|
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
|
||||||
[DEBUG=1]
|
[DEBUG=1]
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Change the source of a mount
|
### Change the source of a mount
|
||||||
|
@ -58,6 +60,7 @@ The following example change the source of the `mymount` mount on
|
||||||
the `myplugin` plugin.
|
the `myplugin` plugin.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
|
$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
|
||||||
/foo
|
/foo
|
||||||
|
|
||||||
|
@ -65,6 +68,7 @@ $ docker plugins set myplugin mymount.source=/bar
|
||||||
|
|
||||||
$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
|
$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
|
||||||
/bar
|
/bar
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**: Since only `source` is settable in `mymount`,
|
> **Note**: Since only `source` is settable in `mymount`,
|
||||||
|
@ -76,6 +80,7 @@ The following example change the path of the `mydevice` device on
|
||||||
the `myplugin` plugin.
|
the `myplugin` plugin.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
|
$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
|
||||||
/dev/foo
|
/dev/foo
|
||||||
|
|
||||||
|
@ -83,6 +88,7 @@ $ docker plugins set myplugin mydevice.path=/dev/bar
|
||||||
|
|
||||||
$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
|
$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
|
||||||
/dev/bar
|
/dev/bar
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**: Since only `path` is settable in `mydevice`,
|
> **Note**: Since only `path` is settable in `mydevice`,
|
||||||
|
@ -93,6 +99,7 @@ $ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$devi
|
||||||
The following example change the source of the args on the `myplugin` plugin.
|
The following example change the source of the args on the `myplugin` plugin.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
||||||
["foo", "bar"]
|
["foo", "bar"]
|
||||||
|
|
||||||
|
@ -100,6 +107,7 @@ $ docker plugins set myplugin args="foo bar baz"
|
||||||
|
|
||||||
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
||||||
["foo", "bar", "baz"]
|
["foo", "bar", "baz"]
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Related commands
|
## Related commands
|
||||||
|
|
|
@ -827,6 +827,7 @@ wo41w8hg8qan hosttempl.1 busybox:latest@sha256:29f5d56d12684887bdfa50dcd29fc31
|
||||||
$ docker inspect --format="{{.Config.Hostname}}" hosttempl.1.wo41w8hg8qanxwjwsg4kxpprj
|
$ docker inspect --format="{{.Config.Hostname}}" hosttempl.1.wo41w8hg8qanxwjwsg4kxpprj
|
||||||
|
|
||||||
x3ti0erg11rjpg64m75kej2mz-hosttempl
|
x3ti0erg11rjpg64m75kej2mz-hosttempl
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Related commands
|
## Related commands
|
||||||
|
|
|
@ -133,10 +133,12 @@ The following example uses a template without headers and outputs the
|
||||||
`ID`, `Mode`, and `Replicas` entries separated by a colon for all services:
|
`ID`, `Mode`, and `Replicas` entries separated by a colon for all services:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker service ls --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
|
$ docker service ls --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
|
||||||
|
|
||||||
0zmvwuiu3vue: replicated 10/10
|
0zmvwuiu3vue: replicated 10/10
|
||||||
fm6uf97exkul: global 5/5
|
fm6uf97exkul: global 5/5
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Related commands
|
## Related commands
|
||||||
|
|
|
@ -166,7 +166,7 @@ myservice
|
||||||
|
|
||||||
### Rolling back to the previous version of a service
|
### Rolling back to the previous version of a service
|
||||||
|
|
||||||
Use the `--rollback` option to roll back to the previous version of the service.
|
Use the `--rollback` option to roll back to the previous version of the service.
|
||||||
|
|
||||||
This will revert the service to the configuration that was in place before the most recent `docker service update` command.
|
This will revert the service to the configuration that was in place before the most recent `docker service update` command.
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ ID NAME MODE REPLICAS IMAGE
|
||||||
80bvrzp6vxf3 web replicated 0/5 nginx:alpine
|
80bvrzp6vxf3 web replicated 0/5 nginx:alpine
|
||||||
|
|
||||||
```
|
```
|
||||||
Roll back the `web` service...
|
Roll back the `web` service...
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker service update --rollback web
|
$ docker service update --rollback web
|
||||||
|
|
|
@ -90,10 +90,12 @@ The following example uses a template without headers and outputs the
|
||||||
`ID`, `Mode`, and `Replicas` entries separated by a colon for all services:
|
`ID`, `Mode`, and `Replicas` entries separated by a colon for all services:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker stack services --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
|
$ docker stack services --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
|
||||||
|
|
||||||
0zmvwuiu3vue: replicated 10/10
|
0zmvwuiu3vue: replicated 10/10
|
||||||
fm6uf97exkul: global 5/5
|
fm6uf97exkul: global 5/5
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -120,21 +120,25 @@ The following example uses a template without headers and outputs the
|
||||||
`Container` and `CPUPerc` entries separated by a colon for all images:
|
`Container` and `CPUPerc` entries separated by a colon for all images:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker stats --format "{{.Container}}: {{.CPUPerc}}"
|
$ docker stats --format "{{.Container}}: {{.CPUPerc}}"
|
||||||
|
|
||||||
09d3bb5b1604: 6.61%
|
09d3bb5b1604: 6.61%
|
||||||
9db7aa4d986d: 9.19%
|
9db7aa4d986d: 9.19%
|
||||||
3f214c61ad1d: 0.00%
|
3f214c61ad1d: 0.00%
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
To list all containers statistics with their name, CPU percentage and memory
|
To list all containers statistics with their name, CPU percentage and memory
|
||||||
usage in a table format you can use:
|
usage in a table format you can use:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker stats --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}"
|
$ docker stats --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}"
|
||||||
|
|
||||||
CONTAINER CPU % PRIV WORKING SET
|
CONTAINER CPU % PRIV WORKING SET
|
||||||
1285939c1fd3 0.07% 796 KiB / 64 MiB
|
1285939c1fd3 0.07% 796 KiB / 64 MiB
|
||||||
9c76f7834ae2 0.07% 2.746 MiB / 64 MiB
|
9c76f7834ae2 0.07% 2.746 MiB / 64 MiB
|
||||||
d1ea048f04e4 0.03% 4.583 MiB / 64 MiB
|
d1ea048f04e4 0.03% 4.583 MiB / 64 MiB
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
|
@ -183,11 +183,13 @@ The following example uses a template without headers and outputs the
|
||||||
`Name` and `Driver` entries separated by a colon for all volumes:
|
`Name` and `Driver` entries separated by a colon for all volumes:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
{% raw %}
|
||||||
$ docker volume ls --format "{{.Name}}: {{.Driver}}"
|
$ docker volume ls --format "{{.Name}}: {{.Driver}}"
|
||||||
|
|
||||||
vol1: local
|
vol1: local
|
||||||
vol2: local
|
vol2: local
|
||||||
vol3: local
|
vol3: local
|
||||||
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Related commands
|
## Related commands
|
||||||
|
|
Loading…
Add table
Reference in a new issue