How to move Docker containers between different hosts?

后端 未结 6 1066
借酒劲吻你
借酒劲吻你 2020-12-04 06:01

I cannot find a way of moving docker running containers from one host to another.

Is there any way I can push my containers to repositories like we do for images ? C

6条回答
  •  被撕碎了的回忆
    2020-12-04 06:52

    You cannot move a running docker container from one host to another.

    You can commit the changes in your container to an image with docker commit, move the image onto a new host, and then start a new container with docker run. This will preserve any data that your application has created inside the container.

    Nb: It does not preserve data that is stored inside volumes; you need to move data volumes manually to new host.

提交回复
热议问题