Lau
Lau

Reputation: 3650

How can I transfer my docker image to another computer?

I created an online shop website in a docker container and want to transfer the image including all my work to another computer. How can I do that?

Upvotes: 7

Views: 16247

Answers (2)

sallu
sallu

Reputation: 386

You will need to save the docker image as a tar file: docker save -o <save image to path> <image name>

Then copy the image to your target machine and then run: docker load -i <path to image tar file>

Upvotes: 14

user2915097
user2915097

Reputation: 32156

it depends if all the data is in your image or if you use volumes

see about docker volumes this doc

https://docs.docker.com/engine/tutorials/dockervolumes/

you can docker save

https://docs.docker.com/engine/reference/commandline/save/

copy the tar archive, and then

docker load

https://docs.docker.com/engine/reference/commandline/load/

and then deal with the data in the volumes if you had

Upvotes: 0

Related Questions