P
P
pcdesign2015-11-01 12:31:27
Virtualization
pcdesign, 2015-11-01 12:31:27

How to move a Docker container from one host to another?

Explain, please, here I have a container.

#docker ps
CONTAINER ID        IMAGE                           COMMAND                CREATED             STATUS              PORTS                                          NAMES
689717b6ce94        magnetikonline/html5validator   "/usr/bin/supervisor   9 weeks ago         Up 9 weeks          0.0.0.0:8888->8888/tcp, 0.0.0.0:8080->80/tcp   validator

It has been amended.
How to completely and completely transfer it to another host?
PS I find information everywhere on how to transfer an image. But I can’t understand if I transfer the image, then after all, all the changes that were made to the container will not be transferred.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya T., 2015-11-01
@pcdesign

More or less like this. I'm writing from memory, no need to copy-paste it, but you need to read the man page for each of the commands.
docker commit validator magnetikonline/html5validator
docker save magnetikonline/html5validator > /tmp/validator.tar
scp /tmp/validator.tar [email protected]:/tmp/validator.tar
---
docker load < /tmp/validator.tar
docker run validator magnetikonline/html5validator

S
Sergey, 2015-11-01
Protko @Fesor

I can’t understand if I transfer the image, then after all, all the changes that were made to the container will not be transferred.

All changes occur with the image (a layer of changes or several layers is added) and not with the "container". In general, it would be nice to still explain what you named it there. dockerfile?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question