4 ms·
Ask HN: What is the use case for stopping a container without destroying it?
- wg0 4y agoI 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.
- bheadmaster 4y agoBesides 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.
- WolfOliver 4y agoins't this an invitation to screw up your app design?
- WolfOliver 4y agoI mean starting and stopping a container won't work anymore if you use a container orchestration layer (e.g. K8s).
- bheadmaster 4y agoYeah. But I suppose it can be used for some basic caching, as long as it's properly implemented. Like some LRU layer over SQLite.