Support json output in --format flag of docker inspect

Docker-DCO-1.1-Signed-off-by: ILYA Khlopotov <ilya.khlopotov@gmail.com> (github: khia)
This commit is contained in:
ILYA Khlopotov 2014-02-28 08:08:01 -08:00 committed by Tibor Vass
parent 0db1996a26
commit 87b94808dc
1 changed files with 13 additions and 0 deletions

View File

@ -809,6 +809,19 @@ we ask for the ``HostPort`` field to get the public address.
$ sudo docker inspect -format='{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}' $INSTANCE_ID
Get config
..........
The ``.Field`` syntax doesn't work when the field contains JSON data,
but the template language's custom ``json`` function does. The ``.config``
section contains complex json object, so to grab it as JSON, you use ``json``
to convert config object into JSON
.. code-block:: bash
$ sudo docker inspect -format='{{json .config}}' $INSTANCE_ID
.. _cli_kill:
``kill``