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:
Brian Goff 2016-07-25 15:24:34 -04:00 committed by Tibor Vass
parent b2dc10a653
commit 347ce7aad3
2 changed files with 10 additions and 0 deletions

View File

@ -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"
}

View File

@ -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