According to https://docs.docker.com/engine/reference/builder/#healthcheck, we can do a health check of containers, giving them some time to boot up, set the number of retries and timeouts, etc.
The question is: is using docker container ls
to see the status of a container the only usage of this feature? I understand that it is very convenient to have a human to see if any of containers are not healthy and decide what to do with those.
Are there any consequences or custom logic in Docker deamon on how to deal with those containers that are unhealthy? Is it possible to configure it to restart those N times automatically in an attempt to bring them back to life? Or any other programmatic use?
docker inspect
and one can query for health statuses. seems like that's all it does and you'd need to write another program to query the status and respond to health failures in various ways