How to list AWS ECR images with latest tag on Windows and Linux

At times , there are cases where we need to get the latest image tag from ECR for one of the repository.

I spend lot of time to figure out how it would be done on Windows and Linux and here is the entire command .

For Windows : 

powershell.exe aws ecr list-images --repository-name <repo-name> | jq '.imageIds | map (.imageTag) | sort | reverse | first'"
For Linux: 
aws ecr list-images --repository-name <repo-name> | jq '.imageIds | map (.imageTag)|sort|.[]' | sort -r | head -1

Hope you find it useful. Thanks

1 thought on “How to list AWS ECR images with latest tag on Windows and Linux”

  1. This has certainly made our jobs a easier. Thank you for creating this content and spreading the beneficial knowledge.
    Continue contributing to the IT world and the world at large.

Leave a Comment

Your email address will not be published. Required fields are marked *