mirror of https://github.com/docker/cli.git
Add formatter for service inspect
Allows the user to use `pretty` as the format string. This enables users to put custom format options into their CLI config just like is supported for `docker ps` and `docker images` Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
b2dc10a653
commit
347ce7aad3
|
@ -143,6 +143,13 @@ Docker's client uses this property. If this property is not set, the client
|
|||
falls back to the default table format. For a list of supported formatting
|
||||
directives, see the [**Formatting** section in the `docker images` documentation](images.md)
|
||||
|
||||
The property `serviceInspectFormat` specifies the default format for `docker
|
||||
service inspect` output. When the `--format` flag is not provided with the
|
||||
`docker service inspect` command, Docker's client uses this property. If this
|
||||
property is not set, the client falls back to the default json format. For a
|
||||
list of supported formatting directives, see the
|
||||
[**Formatting** section in the `docker service inspect` documentation](service_inspect.md)
|
||||
|
||||
Following is a sample `config.json` file:
|
||||
|
||||
{
|
||||
|
@ -151,6 +158,7 @@ Following is a sample `config.json` file:
|
|||
},
|
||||
"psFormat": "table {{.ID}}\\t{{.Image}}\\t{{.Command}}\\t{{.Labels}}",
|
||||
"imagesFormat": "table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.CreatedAt}}",
|
||||
"serviceInspectFormat": "pretty",
|
||||
"detachKeys": "ctrl-e,e"
|
||||
}
|
||||
|
||||
|
|
|
@ -130,6 +130,8 @@ Ports:
|
|||
PublishedPort = 4443
|
||||
```
|
||||
|
||||
You can also use `--format pretty` for the same effect.
|
||||
|
||||
|
||||
### Finding the number of tasks running as part of a service
|
||||
|
||||
|
|
Loading…
Reference in New Issue