Bohne
Bohne

Reputation: 4047

Can Docker containers (NOT Docker images) be moved?

I found this information on the Docker Website

Docker containers can be run, started, stopped, moved, and deleted.

As far as I know, Docker-Images can be moved and Docker-Containers can't. But the information above stands clearly below the headline "Docker containers".

So I would like to know, whether containers could be moved or not (and if not: What is meant with "Docker containers can be moved").

Thanks!

Upvotes: 2

Views: 481

Answers (1)

user2915097
user2915097

Reputation: 32196

You can save a container with

docker save see https://docs.docker.com/reference/commandline/cli/#save

and restore them otherwhere with

docker load see https://docs.docker.com/reference/commandline/cli/#load (it is just a tar file)

but keep in mind this will not save the volumes of the container

https://docs.docker.com/userguide/dockervolumes/#data-volumes

nor the associated volumes from

https://docs.docker.com/userguide/dockervolumes/#creating-and-mounting-a-data-volume-container

For that there is a project

docker-backup https://github.com/discordianfish/docker-backup

Upvotes: 5

Related Questions