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
You can use describe-images instead.
aws ecr describe-images --repository-name foo
returns imagePushedAt
which is a timestamp property which you can use to filter.
I dont have examples in my account to test with but something like following should work
aws ecr describe-images --repository-name foo \
--query 'sort_by(imageDetails,& imagePushedAt)[*]'
If you want another flavor of using sort method, you can review this post