Bug 1381929

Summary: docker-images and docker-inspect man pages lacks simple --format example
Product: Red Hat Enterprise Linux 7 Reporter: Marek Haicman <mhaicman>
Component: dockerAssignee: Antonio Murdaca <amurdaca>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: ajia, amurdaca, dwalsh, lsm5, lsu
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: docker-1.12.6-1.el7_3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-02 19:09:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marek Haicman 2016-10-05 11:34:48 UTC
Description of problem:
As a user of Docker, I was stuck how to form --format field, for `docker images' command. There is no example, only a mention of "go template". As my use case was to create very simple formatting [reduce field to one], all I needed was example like the one in `man docker ps', nothing complex.

docker ps --format "{{.ID}}: {{.Command}}"

In the case of "man docker-inspect", there is one example, but is quite complex.

Version-Release number of selected component (if applicable):
docker-1.10.3-53.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. man docker images


Actual results:
Go template is mentioned, but no example provided

Expected results:
At least some very simple example is there, so admin without experience with Go language can do simple formatting immediately.

Additional info:
Other man pages lack simple example of formatting, but it's probably not necessary to update them, as these are advanced commands:
man docker-network-inspect (golang.org reference is explicit)
man docker-volume-inspect (golang.org reference is explicit)

Comment 2 William Henry 2016-11-22 23:42:05 UTC
sudo docker images --format "{{.ID}}: {{.Tag}}\t{{.Repository}}"

Is a good example. I will try to add it.

Comment 3 William Henry 2016-11-23 06:39:58 UTC
Added an example to docker/man/docker-images.1.md

PR:
https://github.com/docker/docker/pull/28734

Comment 4 William Henry 2016-11-28 20:02:10 UTC
 At github docker/docker:

added this to the 1.13.0 milestone
merged commit 60e72ea into docker:master

Comment 5 William Henry 2016-11-29 23:22:44 UTC
Marek,

I've fixed the 'docker images --format' example upstream. Have you looked at that? Is it enough?

https://github.com/docker/docker/pull/28734

As you pointed out the inspect has examples already and also the inspect structure is more complex so the examples try to show how to find some of the deeper level elements.  Is it intuitive enough or is a simpler example still required?

Dan, any thoughts?


William

Comment 6 Daniel Walsh 2016-11-30 13:31:44 UTC
Looks good to me.

Fixed in docker-1.13 or docker-latest-1.13.

Comment 7 Marek Haicman 2016-12-08 18:56:02 UTC
I think these examples are perfect, thanks!

Comment 10 Antonio Murdaca 2017-01-10 13:27:02 UTC
Backported to docker-1.12.5 branch, Lokesh could you rebuild for RHEL so QE can re-test this out again?

Comment 12 Lokesh Mandvekar 2017-01-18 15:19:41 UTC
will be shipped in 7.3.3

Comment 14 Luwen Su 2017-02-16 09:02:17 UTC
Via docker-1.12.6-5.el7.x86_64, move to verified

Comment 16 errata-xmlrpc 2017-03-02 19:09:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0406.html