add --format flag to docker info

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2016-06-21 09:15:17 +00:00
committed by Tibor Vass
parent 5a3c9e8c24
commit 420b6a91af
5 changed files with 37 additions and 4 deletions

View File

@ -16,7 +16,8 @@ Usage: docker info
Display system-wide information
Options:
--help Print usage
-f, --format string Format the output using the given go template
--help Print usage
```
This command displays system wide information regarding the Docker installation.
@ -24,6 +25,10 @@ Information displayed includes the kernel version, number of containers and imag
The number of images shown is the number of unique images. The same image tagged
under different names is counted only once.
If a format is specified, the given template will be executed instead of the
default format. Go's [text/template](http://golang.org/pkg/text/template/) package
describes all the details of the format.
Depending on the storage driver in use, additional information can be shown, such
as pool name, data file, metadata file, data space used, total data space, metadata
space used, and total metadata space.
@ -144,3 +149,8 @@ information about the devicemapper storage driver is shown:
Insecure registries:
myinsecurehost:5000
127.0.0.0/8
You can also specify the output format:
$ docker info --format '{{json .}}'
{"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...}