AWS CLI: ECR list-images, get newest

前端 未结 5 999
不思量自难忘°
不思量自难忘° 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:35

    To get only latest image with out special character minor addition required for above answer.

    aws ecr describe-images --repository-name foo --query 'sort_by(imageDetails,& imagePushedAt)[-1].imageTags[0]' --output text
    

提交回复
热议问题