will help you Docker only reports the status of the healthcheck. Acting on the healthcheck result requires an extra layer running on top of docker. Swarm mode provides this functionality and is shipped with the docker engine. To enable:
docker swarm init
docker service create -d --net=host applicationname:temp
it helps some times Sergey, youre need to use initialization system as supervisor of your in-Docker processes. You may use distro-built-in init systems like systemd/upstart or init.d depends on your OS for checking a container state. In theory you should to create independent service in you init system on each docker run command without -d option, because with -d option docker detached a container and returned 0 exit status to init system. As result init system lost a control of target process.
Description=Simple Blog Rails Docker Container Service
ExecStartPre=-/usr/bin/docker kill simple-blog-rails-container
ExecStartPre=-/usr/bin/docker rm simple-blog-rails-container
ExecStart=/usr/bin/docker run simple-blog-rails
ExecStop=/usr/bin/docker stop simple-blog-rails-container
Health Check command for docker(1.12) container (Not in Dockerfile!)
will be helpful for those in need I don't think you even need marathon-autoscale to do this. This should work outside the box - you may configure a healthcheck that will kill a running Marathon task after 10 consecutive healthcheck failures and start a new one. Something simple would look like that:
Any of those help Turns out to be that docker thought that it and or containterd was still running(which it wasn't, but the PID files didn't get cleaned up) Recommended starting approach to debugging issues: Look at the log files. I am shocked by this revelation.
How to add health check for python code in docker container
help you fix your problem The health check command is not something magical, but rather something you can automate to get a better status on your service. Some questions you should ask yourself before setting the healthcheck: