AWS CLI: ECR list-images, get newest

前端 未结 5 994
不思量自难忘°
不思量自难忘° 2020-12-31 04:48

Using AWS CLI, and jq if needed, I\'m trying to get the tag of the newest image in a particular repo.

Let\'s call the repo foo, and sa

5条回答
  •  执笔经年
    2020-12-31 05:31

    Without having to sort the results, you can filter them specifying the imageTag=latest on image-ids, like so:

    aws ecr describe-images --repository-name foo --image-ids imageTag=latest --output text
    

    This will return only one result with the newest image, which is the one tagged as latest

提交回复
热议问题