0

I was wondering if there was a way to clone images from a local server.

The servers running containers will be hosted behind a bandwidth constrained connection. It would be great if there was a way to pull given containers for one server and then pull from that initial local server to update the containers on the remaining servers.

2 Answers 2

7

You could pull those images you want, give hem a new tag, and put them in your own registry.

For instance, let's say you pulled down the official registry image and stood it up at myregistry.internal.mycompany.com. Now, if you wanted to have a CentOS image available for all of your servers but didn't want to pull them all from the official repo (incurring the bandwitch charges) then you could pull a CentOS image (let's say centos:latest - docker pull centos) and then give that image a new tag, like this:

docker tag centos:latest myregistry.internal.mycompany.com/centos:latest

Now from your other servers you just pull 'myregistry.internal.mycompany.com/centos:latest'

Setting up your own repo is really easy as a docker container itself. You can pull the image and learn more at https://registry.hub.docker.com/_/registry/

Sign up to request clarification or add additional context in comments.

Comments

2

I think you have a few options. If what you actually want to manage is images rather than containers:

  1. You could set up a private Docker registry, and then push to/pull from that local repository. This may ultimately be the easiest if that is something that you want to do fairly often, because you're just using standard docker push/docker pull commands.

  2. You could use docker save to save images on one server and docker load to load the images on another server.

If you are actually trying to move containers around:

  1. You could use docker export on one server and docker import on another server.

1 Comment

Thanks, I might setup a local registry, the images are located in a private registry in a different location, but I remember it being a bit time consuming to setup. Will read up on the import/export as well, wasn't aware that existed, thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.