-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker inspect -f json pretty print #110
Comments
work around (any hint for myself): pipe the output to a json-pretty-printer docker inspect -f '{{json .NetworkSettings.Networks}}' db | python -m json.tool # from above
docker inspect -f '{{json .NetworkSettings.Networks}}' db | json_pp
# or any other I like the current output on one line for docker ls commands (docker stack ls, docker container ls, docker container ps, ...). |
There is jq to which you can pipe your output. ej. like this below:
or
|
This was discussed at some point, and decided not to add in order to not overload the options for Closing this for now, but feel free to continue the conversation |
I guess there's other reasons now because I can see that |
Expected behavior
When executing
docker <object> inspect -f='{{json <parameters>}}'
for containers, networks, etc., the json object should be formatted just like in the case where we don't use the-f
option; that is, pretty-printed, e.g.:Actual behavior
The JSON object is not pretty printed:
I could not find any option for that either in the available template functions of
inspect
, or in theinspect
command help:Steps to reproduce the behavior
Run
docker inspect
for an existing container or network, using the-f
option:Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.)
Running in a Virtualbox Ubuntu 16.04.3 LTS relesae
The text was updated successfully, but these errors were encountered: