Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy docker image between repositories

Tags:

docker

I have 2 private docker repositories. Is any way how can I copy one image from one repository to the second one?

like image 712
Piotr Stapp Avatar asked Apr 23 '18 08:04

Piotr Stapp


People also ask

How do I copy a docker image from one repo to another?

In order to transfer a Docker image from one server to another, what you need to do is first export the image to a file, then copy that file over from your current server to the new one using scp or rsync and finally load the image to your new server.

Can we share docker image?

To share Docker images, you have to use a Docker registry. The default registry is Docker Hub and is where all of the images we've used have come from. A Docker ID allows you to access Docker Hub which is the world's largest library and community for container images. Create a Docker ID for free if you don't have one.


2 Answers

You can pull the image, tag it and push it to the new registry.

Example:

docker pull old-registry/app:some_tag docker tag old-registry/app:some_tag new-registry/app:some_tag docker push new-registry/app:some_tag 
like image 104
adebasi Avatar answered Oct 10 '22 17:10

adebasi


Can be done with https://github.com/containers/skopeo

Example for the README:

skopeo copy docker://quay.io/buildah/stable docker://registry.internal.company.com/buildah 

The advantage is that Skopeo does not require Docker on the machine it runs on.

like image 44
MajorBreakfast Avatar answered Oct 10 '22 17:10

MajorBreakfast