I am stuck at with the rollback strategies on Amazon ECS using Amazon ECR as docker registry. I want to maintain the latest 5 image versions(say latestv1 latestv2 latestv3 latestv4 latestv5 etc) and Want to rollback to latestv4 if the code on latestv5 fails.
I have tried using amazon ecr cli and It gives me the all of the unsorted tags.
aws ecr describe-images --repository-name api-gateway-demo --output json --query imageDetails[*].imageTags
Output:
[
[
"latestv2"
],
[
"latestv1"
],
[
"latestv5"
],
[
"latestv3"
],
[
"latestv4"
]
]
Any idea to manage the versioning of the images for better deployment/rollbacks on ECR?