HACKER Q&A
📣 WolfOliver

What is the use case for stopping a container without destroying it?


What is the use case for stopping a container without destroying it?


  👤 bheadmaster Accepted Answer ✓
Besides faster start time, one use case would be state persistence.

If you have a process that writes stuff to a file inside a container (not in a volume or mounted path), stopping a container without destroying it doesn't delete the modifications. Starting the container again may allow the process to read the contents of the file, possibly continuing its execution from some checkpoint.


👤 wg0
I guess faster start up time because layers won't be re-extracted from the image and the "rootfs" would be in place hence faster startup times.

Other use case would be with stateful containers such as running a database, stopping it and starting it again without losing data (which already should be on a mounted volume)

Interested to know if there are other use cases.