3 ms·
I've only used docker for local dev environments, so I'm curious what happens if the process crashes? Does the docker daemon perform health checks to restart it
by lordofgibbons 3y ago
I've only used docker for local dev environments, so I'm curious what happens if the process crashes? Does the docker daemon perform health checks to restart it, or is that the domain of k8s? It's pretty simple to do with systemd.
- vbezhenar 3y agoDocker and kubernetes are different things. But both systems can restart crashed containers. That's not an issue at all. Kubernetes does it automatically. Docker does not do it automatically but you just need to supply proper option for `run` (or just in docker-compose.yaml).
- nine_k 3y agoPlain systemd can run docker containers, and keep them up if they crash. (Yes, systemd can be a useful thing sometimes!) Also, Docker and Podman know how to restart containers if needed, depending on a policy you set. If you want something even smaller, take https://github.com/containers/bubblewrap https://github.com/containers/bubblewrap or https://github.com/arachsys/containers https://github.com/arachsys/containers and run them under the process monitor of your choice, like runit or s6.
- faangsticle 3y agoSimplest form is `docker run --restart=unless-stopped` and `systemctl enable docker` They will restart when crash, and after reboot.