Update reference documentation

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Silvin Lubecki 2021-03-10 00:49:33 +01:00 committed by Sebastiaan van Stijn
parent 0611be0f09
commit b4af799686
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
14 changed files with 164 additions and 16 deletions

View File

@ -15,8 +15,12 @@ Aliases:
ls, list
Options:
--format string Pretty-print contexts using a Go template
(default "table")
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
-q, --quiet Only show context names
```

View File

@ -20,7 +20,12 @@ Options:
- before=(<image-name>[:tag]|<image-id>|<image@digest>)
- since=(<image-name>[:tag]|<image-id>|<image@digest>)
- reference=(pattern of an image reference)
--format string Pretty-print images using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--help Print usage
--no-trunc Don't truncate output
-q, --quiet Only show image IDs
@ -341,3 +346,11 @@ b6fa739cedf5 committ latest
746b819f315e postgres 9.3.5
746b819f315e postgres latest
```
To list all images in JSON format, use the `json` directive:
```console
$ docker images --format json
{"Containers":"N/A","CreatedAt":"2021-03-04 03:24:42 +0100 CET","CreatedSince":"5 days ago","Digest":"\u003cnone\u003e","ID":"4dd97cefde62","Repository":"ubuntu","SharedSize":"N/A","Size":"72.9MB","Tag":"latest","UniqueSize":"N/A","VirtualSize":"72.9MB"}
{"Containers":"N/A","CreatedAt":"2021-02-17 22:19:54 +0100 CET","CreatedSince":"2 weeks ago","Digest":"\u003cnone\u003e","ID":"28f6e2705743","Repository":"alpine","SharedSize":"N/A","Size":"5.61MB","Tag":"latest","UniqueSize":"N/A","VirtualSize":"5.613MB"}
```

View File

@ -12,7 +12,7 @@ Usage: docker info [OPTIONS]
Display system-wide information
Options:
-f, --format string Format the output using the given Go template
-f, --format string Format the output using the given Go template (default "json")
--help Print usage
```

View File

@ -16,7 +16,12 @@ Aliases:
Options:
-f, --filter filter Provide filter values (e.g. 'driver=bridge')
--format string Pretty-print networks using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--help Print usage
--no-trunc Do not truncate the output
-q, --quiet Only display network IDs
@ -230,6 +235,15 @@ d1584f8dc718: host
391df270dc66: null
```
To list all networks in JSON format, use the `json` directive:
```console
$ docker network ls --format json
{"CreatedAt":"2021-03-09 21:41:29.798999529 +0000 UTC","Driver":"bridge","ID":"f33ba176dd8e","IPv6":"false","Internal":"false","Labels":"","Name":"bridge","Scope":"local"}
{"CreatedAt":"2021-03-09 21:41:29.772806592 +0000 UTC","Driver":"host","ID":"caf47bb3ac70","IPv6":"false","Internal":"false","Labels":"","Name":"host","Scope":"local"}
{"CreatedAt":"2021-03-09 21:41:29.752212603 +0000 UTC","Driver":"null","ID":"9d096c122066","IPv6":"false","Internal":"false","Labels":"","Name":"none","Scope":"local"}
```
## Related commands
* [network disconnect ](network_disconnect.md)

View File

@ -16,7 +16,12 @@ Aliases:
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print nodes using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--help Print usage
-q, --quiet Only display IDs
```
@ -203,6 +208,11 @@ e216jshn25ckzbvmwlnh5jr3g: swarm-manager1 Ready
35o6tiywb700jesrt3dmllaza: swarm-worker1 Needs Rotation
```
To list all nodes in JSON format, use the `json` directive:
```console
$ docker node ls --format json
{"Availability":"Active","EngineVersion":"20.10.5","Hostname":"docker-desktop","ID":"k8f4w7qtzpj5sqzclcqafw35g","ManagerStatus":"Leader","Self":true,"Status":"Ready","TLSStatus":"Ready"}
```
## Related commands

View File

@ -16,7 +16,12 @@ Aliases:
Options:
-f, --filter filter Provide filter values (e.g. 'enabled=true')
--format string Pretty-print plugins using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--help Print usage
--no-trunc Don't truncate output
-q, --quiet Only display plugin IDs
@ -96,6 +101,12 @@ $ docker plugin ls --format "{{.ID}}: {{.Name}}"
4be01827a72e: vieux/sshfs:latest
```
To list all plugins in JSON format, use the `json` directive:
```console
$ docker plugin ls --format json
{"Description":"sshFS plugin for Docker","Enabled":false,"ID":"856d89febb1c","Name":"vieux/sshfs:latest","PluginReference":"docker.io/vieux/sshfs:latest"}
```
## Related commands
* [plugin create](plugin_create.md)

View File

@ -30,7 +30,12 @@ Options:
- since=(<container-name>|<container-id>)
- status=(created|restarting|removing|running|paused|exited)
- volume=(<volume name>|<mount point destination>)
--format string Pretty-print containers using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--help Print usage
-n, --last int Show n last created containers (includes all states) (default -1)
-l, --latest Show the latest created container (includes all states)
@ -445,3 +450,9 @@ a87ecb4f327c com.docker.swarm.node=ubuntu,com.docker.swarm.storage=ssd
c1d3b0166030 com.docker.swarm.node=debian,com.docker.swarm.cpu=6
41d50ecd2f57 com.docker.swarm.node=fedora,com.docker.swarm.cpu=3,com.docker.swarm.storage=ssd
```
To list all running containers in JSON format, use the `json` directive:
```console
$ docker ps --format json
{"Command":"\"/docker-entrypoint.…\"","CreatedAt":"2021-03-10 00:15:05 +0100 CET","ID":"a762a2b37a1d","Image":"nginx","Labels":"maintainer=NGINX Docker Maintainers \u003cdocker-maint@nginx.com\u003e","LocalVolumes":"0","Mounts":"","Names":"boring_keldysh","Networks":"bridge","Ports":"80/tcp","RunningFor":"4 seconds ago","Size":"0B","State":"running","Status":"Up 3 seconds"}
```

View File

@ -16,7 +16,13 @@ Aliases:
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print secrets using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--help Print usage
-q, --quiet Only display IDs
```
@ -148,6 +154,12 @@ b6fa739cedf5 secret-2 3 hours ago
78a85c484f71 secret-3 10 days ago
```
To list all secrets in JSON format, use the `json` directive:
```console
$ docker secret ls --format json
{"CreatedAt":"28 seconds ago","Driver":"","ID":"4y7hvwrt1u8e9uxh5ygqj7mzc","Labels":"","Name":"mysecret","UpdatedAt":"28 seconds ago"}
```
## Related commands
* [secret create](secret_create.md)

View File

@ -16,7 +16,12 @@ Aliases:
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print services using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--help Print usage
-q, --quiet Only display IDs
```
@ -153,6 +158,12 @@ $ docker service ls --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
fm6uf97exkul: global 5/5
```
To list all services in JSON format, use the `json` directive:
```console
$ docker service ls --format json
{"ID":"ssniordqolsi","Image":"hello-world:latest","Mode":"replicated","Name":"hello","Ports":"","Replicas":"0/1"}
```
## Related commands
* [service create](service_create.md)

View File

@ -16,7 +16,12 @@ Aliases:
Options:
--help Print usage
--format string Pretty-print stacks using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
```
## Description
@ -68,6 +73,12 @@ web-server: 1
web-cache: 4
```
To list all stacks in JSON format, use the `json` directive:
```console
$ docker stack ls --format json
{"Name":"myapp","Namespace":"","Orchestrator":"Swarm","Services":"3"}
```
## Related commands
* [stack deploy](stack_deploy.md)

View File

@ -13,7 +13,12 @@ List the tasks in the stack
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print tasks using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--help Print usage
--no-resolve Do not map IDs to Names
--no-trunc Do not truncate output
@ -157,6 +162,14 @@ voting_vote.2: dockersamples/examplevotingapp_vote:before
voting_redis.2: redis:alpine
```
To list all tasks in JSON format, use the `json` directive:
```console
$ docker stack ps --format json myapp
{"CurrentState":"Preparing 23 seconds ago","DesiredState":"Running","Error":"","ID":"2ufjubh79tn0","Image":"localstack/localstack:latest","Name":"myapp_localstack.1","Node":"docker-desktop","Ports":""}
{"CurrentState":"Running 20 seconds ago","DesiredState":"Running","Error":"","ID":"roee387ngf5r","Image":"redis:6.0.9-alpine3.12","Name":"myapp_redis.1","Node":"docker-desktop","Ports":""}
{"CurrentState":"Preparing 13 seconds ago","DesiredState":"Running","Error":"","ID":"yte68ouq7glh","Image":"postgres:13.2-alpine","Name":"myapp_repos-db.1","Node":"docker-desktop","Ports":""}
```
### Do not map IDs to Names
The `--no-resolve` option shows IDs for task name, without mapping IDs to Names.

View File

@ -13,7 +13,12 @@ List the services in the stack
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print services using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--help Print usage
-q, --quiet Only display IDs
```
@ -98,6 +103,14 @@ $ docker stack services --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
fm6uf97exkul: global 5/5
```
To list all services in JSON format, use the `json` directive:
```console
$ docker stack services ls --format json
{"ID":"0axqbl293vwm","Image":"localstack/localstack:latest","Mode":"replicated","Name":"myapp_localstack","Ports":"*:4566-\u003e4566/tcp, *:8080-\u003e8080/tcp","Replicas":"0/1"}
{"ID":"384xvtzigz3p","Image":"redis:6.0.9-alpine3.12","Mode":"replicated","Name":"myapp_redis","Ports":"*:6379-\u003e6379/tcp","Replicas":"1/1"}
{"ID":"hyujct8cnjkk","Image":"postgres:13.2-alpine","Mode":"replicated","Name":"myapp_repos-db","Ports":"*:5432-\u003e5432/tcp","Replicas":"0/1"}
```
## Related commands

View File

@ -12,7 +12,12 @@ Usage: docker system df [OPTIONS]
Show docker filesystem usage
Options:
--format string Pretty-print images using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--help Print usage
-v, --verbose Show detailed information on space usage
```
@ -122,6 +127,15 @@ Local Volumes 150.3 MB 150.3 MB (100%)
<Paste>
```
To list all information in JSON format, use the `json` directive:
```console
$ docker system df --format json
{"Active":"2","Reclaimable":"2.498GB (94%)","Size":"2.631GB","TotalCount":"6","Type":"Images"}
{"Active":"1","Reclaimable":"1.114kB (49%)","Size":"2.23kB","TotalCount":"7","Type":"Containers"}
{"Active":"0","Reclaimable":"256.5MB (100%)","Size":"256.5MB","TotalCount":"1","Type":"Local Volumes"}
{"Active":"0","Reclaimable":"158B","Size":"158B","TotalCount":"17","Type":"Build Cache"}
```
**Note** the format option is meaningless when verbose is true.
## Related commands

View File

@ -20,7 +20,12 @@ Options:
- driver=<string> a volume's driver name
- label=<key> or label=<key>=<value>
- name=<string> a volume's name
--format string Pretty-print volumes using a Go template
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--help Print usage
-q, --quiet Only display volume names
```
@ -182,6 +187,12 @@ vol2: local
vol3: local
```
To list all volumes in JSON format, use the `json` directive:
```console
$ docker volume ls --format json
{"Driver":"local","Labels":"","Links":"N/A","Mountpoint":"/var/lib/docker/volumes/docker-cli-dev-cache/_data","Name":"docker-cli-dev-cache","Scope":"local","Size":"N/A"}
```
## Related commands
* [volume create](volume_create.md)