Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker-machine stop command kills all my containers

I am using docker-machine, and I created a VM with VirtualBox driver. I would like to pause my machine without killing all the running docker dontainers in that machine. Is this possible to do somehow? I would like to resume my machine, and resume all my containers that were running.

like image 583
user1340582 Avatar asked Sep 11 '15 20:09

user1340582


People also ask

Does docker stop kill all processes?

Docker Stop COMMAND. The docker stop command stops the container gracefully and provides a safe way out. If a docker stop command fails to terminate a process within the specified timeout, the Docker issues a kill command implicitly and immediately.

Does stopping docker stop containers?

The docker stop command attempts to stop a running container first by sending a SIGTERM signal to the root process (PID 1) in the container. If the process hasn't exited within the timeout period a SIGKILL signal will be sent.

Why is docker killing my container?

The container has consumed too much memory, and has been killed by the host OS: If the operating system detects that it's running out of memory, it might start killing processes to free up memory. If a container is using a lot of memory or resources, it might be killed by the OS.

How do I stop docker from running all containers?

If you do, killing multiple containers takes one command: docker-compose down. You could also run docker-compose without detached mode. If so, you'll just use ^C to kill all containers. And there you have it—all containers killed!


1 Answers

You should be able to do it as long as you use Pause or Save State on Virtualbox. When you use Pause or Save State on VirtualBox all of your 'run' state is stored on the disk and then when you Unpause or Restart that 'run' state is restore from disk. Tried it myself and it works great.

Save State/Pause

This equivalent to using 'Suspend' on VMware.

like image 60
Rico Avatar answered Sep 22 '22 03:09

Rico