'how to copy docker images from nexus docker repo to aws ecr in jenkins pipeline

I have requirement to copy all nexus images to aws ece but not sure how to do it how to copy docker images from nexus docker repo to aws ecr in jenkins pipeline



Solution 1:[1]

I would assume that the easiest option would be to pull the image from the nexus , retag and push.

Let's say you have docker-nexus.example.com as your docker nexus repo. The AWS ECR has it's own unique DNS which can't be hidden behind DNS unless with NGINX proxy and even there i read are some issues but for easier understanding let's call it a docker-ecr.aws.amazon.com And use the docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

So what you would do is

docker pull docker-nexus.example.com/application1:version1 docker tag docker-nexus.example.com/application1:version1 docker-ecr.aws.amazon.com/application1:version1 docker push docker-ecr.aws.amazon.com/application1:version1

And repeat cross all images.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 caszador