From 347ce7aad39ee852e77d74b9cb19d43872f933e1 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Mon, 25 Jul 2016 15:24:34 -0400 Subject: [PATCH] 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 --- docs/reference/commandline/cli.md | 8 ++++++++ docs/reference/commandline/service_inspect.md | 2 ++ 2 files changed, 10 insertions(+) diff --git a/docs/reference/commandline/cli.md b/docs/reference/commandline/cli.md index 3982941d75..51a8dd6aba 100644 --- a/docs/reference/commandline/cli.md +++ b/docs/reference/commandline/cli.md @@ -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" } diff --git a/docs/reference/commandline/service_inspect.md b/docs/reference/commandline/service_inspect.md index 2fbaedd8fe..4923d8e706 100644 --- a/docs/reference/commandline/service_inspect.md +++ b/docs/reference/commandline/service_inspect.md @@ -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