Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clone an image from a docker registry to another

I have a private registry with a set of images. It can be visualized as a store of applications. My app can take these applications and run them on other machines. To achieve this, my app first pull the image from the private registry and then copies it to a local registry for later use.

Step as are follow:

docker pull privateregistry:5000/company/app:tag
docker tag privateregistry:5000/company/app:tag localregistry:5000/company/app:tag
docker push localregistry:5000/company/app:tag

Then later on a different machine in my network:

docker pull localregistry:5000/company/app:tag

Is there a way to efficiently copy an image from a repository to another without using a docker client in between ?

like image 307
dynamic_cast Avatar asked Jul 07 '17 15:07

dynamic_cast


People also ask

How do I copy a docker image from one registry 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 copy Docker images from one host to another?

Copy Docker images from one host to another by tar files Docker allows you to save images into tar files using the docker save . This command also compresses images and enables sharing them easily and quickly. You can then use the docker load command to load the Docker image back from the tar file into another host.

How do I clone a docker image?

To 'clone' a container, you'll have to make an image of that container first, you can do so by "committing" the container. Docker will (by default) pause all processes running in the container during commit to preserve data-consistency. Commit my_container as an image called my_container_snapshot , and tag it yymmdd .


1 Answers

you can use docker save to save the images to tar archive and then copy the tar to new host and use docker load to untar it.

read below links for more https://docs.docker.com/engine/reference/commandline/save/

like image 70
Nitish Mowall Avatar answered Nov 10 '22 20:11

Nitish Mowall