mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Explain 'json' function a bit better
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
effdb3b763
commit
c170e97197
1 changed files with 6 additions and 6 deletions
|
@ -65,11 +65,11 @@ the `HostPort` field to get the public address.
|
||||||
|
|
||||||
$ docker inspect --format='{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}' $INSTANCE_ID
|
$ docker inspect --format='{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}' $INSTANCE_ID
|
||||||
|
|
||||||
**Get config:**
|
**Get a subsection in JSON format:**
|
||||||
|
|
||||||
The `.Field` syntax doesn't work when the field contains JSON data, but
|
If you request a field which is itself a structure containing other
|
||||||
the template language's custom `json` function does. The `.config`
|
fields, by default you get a Go-style dump of the inner values.
|
||||||
section contains complex JSON object, so to grab it as JSON, you use
|
Docker adds a template function, `json`, which can be applied to get
|
||||||
`json` to convert the configuration object into JSON.
|
results in JSON format.
|
||||||
|
|
||||||
$ docker inspect --format='{{json .config}}' $INSTANCE_ID
|
$ docker inspect --format='{{json .Config}}' $INSTANCE_ID
|
||||||
|
|
Loading…
Add table
Reference in a new issue