Indian Web Developer
Indian Web Developer

Reputation: 41

Need to move docker from one mac to another mac

I do not have internet connection in one of my mac. I need to use docker pull. What I thought is that I will use docker pull in one of my mac with internet connection and then copy that to my mac which has no internet connection. How can such copying be done?

Upvotes: 3

Views: 2276

Answers (2)

Elton Stoneman
Elton Stoneman

Reputation: 19194

Use docker save on the source machine to save the image to a TAR file, copy the TAR to the destination machine and run docker load:

> docker pull ubuntu:16.04
16.04: Pulling from library/ubuntu
Digest: sha256:28d4c5234db8d5a634d5e621c363d900f8f241240ee0a6a978784c978fe9c737
Status: Downloaded newer image for ubuntu:16.04

> docker save -o ubuntu-16.04.tar ubuntu:16.04
> ll *.tar 
-rw------- 1 scrapbook scrapbook 132771840 Oct  5 08:32 ubuntu-16.04.tar

Copy the file and then on the second box:

> docker load -i ubuntu-16.04.tar
Loaded image: ubuntu:16.04

It will be loaded with the original image tag, so on the second box you can refer to this example as ubuntu:16.04.

Upvotes: 4

Alex
Alex

Reputation: 809

On Linux I would just copy /var/lib/docker/ to the other machine.

As this answer states this directory equals the following on mac:

~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2

So try copying that directory to your second mac. Unfortunately I can't try it myself but it's a hint for you maybe :)

Upvotes: 0

Related Questions