title: 'docker images' output as json using --format
body: <p>I am having some difficulty understanding how to make use of docker's --format option.</p>
  
  <p>For example, if I run 'docker images' i get the following:</p>
  
  <pre><code>$ docker images
  
  REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
  repo1               305                 123456678676        4 hours ago         500MB
  repo1               latest              123431241245        4 hours ago         500MB
  repo2               305                 135151251531        4 hours ago         2.39GB
  </code></pre>
  
  <p>I would like to get results for the images of 'repo1', in JSON format.    I found the following page:  <a href="https://docs.docker.com/config/formatting/" rel="noreferrer">https://docs.docker.com/config/formatting/</a> . For the 'json' example, it mentions 'go formatting' is used, however the link provided I am having a hard time making the connection.  And the json example on the page is only for a single column.  I'm having difficulty figuring out how to get all of the columns, but only for certain repo images.</p>
  
  <p>Also - does anyone know if this is backwards compatible?  I will need it to work on older versions of docker, so if it is only available on newer version, maybe it's best to parse the output myself.  I can not use docker APIs.</p>