How I can migrate my already built docker images with custom tags from dockerhub to amazon ECR?

Due to rate limiting of Dockerhub I migrated from dockerHub to AmazonECR. I managed to push new images to docker ECR but I want to migrate existing tags from dockerhub to Amazon ECR.

Do you know how I can do that?


Solution 1:

I had to transfer from one ECR to another last week, the commands were something like this

(any required login to source repo)

docker pull repo.com/image-name:1.0

docker tag repo.com/image-name:1.0 012345678910.dkr.ecr.us-east-1.amazonaws.com/image-name:1.0

aws ecr get-login-password --region us-east-1 --profile aws-profile-name | docker login --username AWS --password-stdin 012345678910.dkr.ecr.us-east-1.amazonaws.com

docker push 012345678910.dkr.ecr.us-east-1.amazonaws.com/image-name:1.0