mirror of
https://github.com/docker/cli.git
synced 2026-01-06 05:41:44 +03:00
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:
committed by
Sebastiaan van Stijn
parent
0611be0f09
commit
b4af799686
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user