4 ms·
> (...) but Docker doesn’t handle it, because the Tomcat process is still running. ...and that's why no one uses it that way, and instead uses Docker's built-
by rualca 6y ago
> (...) but Docker doesn’t handle it, because the Tomcat process is still running.
...and that's why no one uses it that way, and instead uses Docker's built-in support for healthchecks.
Check out the HEALTHCHECK entry in Docker's reference
https://docs.docker.com/engine/reference/builder/ https://docs.docker.com/engine/reference/builder/
- mrweasel 6y agoBut they don’t.... they should, but don’t. I’ve helped plenty of client either redesign their containers, or implement healthchecks. Note that adding the healthcheck isn’t enough. Docker won’t actually do anything if a container is unhealthy. You need a seperate process to restart the unhealthy container.
- technological 6y agoWe use hashicorp nomad, which handles the restart of unhealthy container. I think if ppl are using large number of containers (scale of more than 1000) then they would have some sort of tool that manages them
- 2ion 6y agoAll our containers expose meaningful healthcheck endpoints. We practice STONITH for fencing. And we define service health purely using SLIs that reflect actual service usage (or ability to use the service). As such, we do not rely on Docker HEALTHCHECKs. We don't want to rely on a container measuring its own health; we often had issues with developers putting the equivalent of "return true;" inside their checks…
- rualca 6y ago> And we define service health purely using SLIs that reflect actual service usage (or ability to use the service). As such, we do not rely on Docker HEALTHCHECKs. We don't want to rely on a container measuring its own health I'm not sure you fully grasp the issue or understand how Docker works. Docker's healthchecks are not "container measuring its own health". Docker's healthchecks are a standard interface that was designed to allow container orchestration services to poll containers to check if they are still in working order. From your own description, it sounds like you tried to reinvent the wheel, and did it poorly. And I'm sorry to break it to you, but if you have developers faking health checks in production then your choice of container runtime or container orchestration system is not the problem you need to worry about.