title: AWS CLI: ECR list-images, get newest
body: <p>Using AWS CLI, and jq if needed, I'm trying to <strong>get the tag of the newest image in a particular repo</strong>. </p>
  
  <p>Let's call the repo <code>foo</code>, and say the latest image is tagged <code>bar</code>. What query do I use to return <code>bar</code>?</p>
  
  <p>I got as far as </p>
  
  <pre><code>aws ecr list-images --repository-name foo
  </code></pre>
  
  <p>and then realized that the <a href="http://docs.aws.amazon.com/cli/latest/reference/ecr/list-images.html" rel="noreferrer">list-images documentation</a> gives no reference to the date as a queryable field. Sticking the above in a terminal gives me keypairs with just the tag and digest, no date. </p>
  
  <p>Is there still some way to get the "latest" image? Can I assume it'll always be the first, or the last in the returned output?</p>