Copy docker image from one AWS ECR repo to another

Amazon Web-ServicesAws Ecr

Amazon Web-Services Problem Overview


We want to copy a docker image from non-prod to prod ECR account. Is it possible without pulling, retaging and pushing it again.

Amazon Web-Services Solutions


Solution 1 - Amazon Web-Services

No you have to run these commands

docker login OLD_REPO
docker pull OLD_REPO/IMAGE:TAG
docker tag OLD_REPO/IMAGE:TAG NEW_REPO/IMAGE:TAG
docker login NEW_REPO
docker push NEW_REPO/IMAGE:TAG

Solution 2 - Amazon Web-Services

I have written this program in python to migrate all the images (or a specific image) from a repository to another region or to another account in a different region https://gist.github.com/fabidick22/6a1962697357360f0d73e01950ae962b

Solution 3 - Amazon Web-Services

Answer: No, you must pull, tag, and push.

I wrote a bash script for this today. You can specify the number of tagged images that will be copied.

https://gist.github.com/virtualbeck/a635ef6701991f2087384eab7edbb18b

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionletthefirefliesliveView Question on Stackoverflow
Solution 1 - Amazon Web-ServicesBanjo ObayomiView Answer on Stackoverflow
Solution 2 - Amazon Web-Servicesfabidick22View Answer on Stackoverflow
Solution 3 - Amazon Web-ServicesMike BeckView Answer on Stackoverflow