Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rollback in Amazon ECS with Amazon ECR?

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?

like image 744
mohit Avatar asked Oct 27 '25 05:10

mohit


1 Answers

From my experience the best scenario is to tag the image so you can rollback anytime from your registry private or not. https://docs.docker.com/engine/reference/commandline/tag/

Also this might help you Is there a way to tag a previous layer in a docker image or revert a commit?

like image 172
JohnBegood Avatar answered Oct 28 '25 17:10

JohnBegood