`always` vs `unless-stopped`: which do you use?
BeginnerProductionResource Limits, Health & Reliability
Answer
unless-stopped for services: if you stopped a container deliberately, it stays down after a host reboot or daemon restart. always brings it back regardless. on-failure suits batch jobs and workers where a clean exit (0) means done. Combine with live-restore so daemon upgrades do not bounce containers.
More on Resource Limits, Health & Reliability
How do you set memory and CPU limits, and what happens when they are exceeded?BeginnerWhat is the difference between `--cpus`, `--cpu-shares` and `--cpuset-cpus`?BeginnerWhat does `--memory-reservation` do?AdvancedHow do you diagnose an OOM-killed container?IntermediateWhy do JVM and Node services in containers need explicit memory flags?IntermediateWhat is CPU throttling, and how do you detect it?Advanced