...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
...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
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.
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.