Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does restart of the computer kill docker containers?

Tags:

docker

I have a few containers running in my local machine but since my computer is responding extremely slow as I haven't shut it down in many months. But I don't want my containers to be deleted if I restart my computer in order to make my computer fast again. I want to know will it kill my local running docker containers if I restart it? or does it keep docker containers in memory?

like image 452
Priyanka Wagh Avatar asked Dec 03 '25 18:12

Priyanka Wagh


1 Answers

All your container will be stopped when you reboot your computer. Docker will try to gracefully stop them.

If you run your container with the --rm flag, the container will be deleted on stop, otherwise, it will continue to exists.

If you run your container with the --restart flag with the value always, when the docker daemon start, the container will be started. Else, you need to start them manually with docker start <container id or name>

like image 111
jmaitrehenry Avatar answered Dec 06 '25 10:12

jmaitrehenry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!