16

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 ?

dynamic_cast
  • 1,075
  • 1
  • 9
  • 23

2 Answers2

2

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/

Nitish Mowall
  • 139
  • 1
  • 11
  • Yeah, this works, but it is a very large image. But it will get the job done without having to use a container registry. – Antebios Oct 12 '20 at 04:54
2

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

Yes, there's a variety of tools that implement this today. RedHat has been pushing their skopeo, Google has crane, and I've been working on my own with regclient. Each of these tools talks directly to the registry server without needing a docker engine. And at least with regclient (I haven't tested the others), these will only copy the layers that are not already in the target registry, avoiding the need to pull layers again. Additionally, you can move a multi-platform image, retaining all of the available platforms, which you would lose with a docker pull since that dereferences the image to a single platform.

BMitch
  • 231,797
  • 42
  • 475
  • 450