Skip to content
hcd : Health Care Daemon for docker
Branch: master
Clone or download
Latest commit ea53cde Dec 20, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile Update Dockerfile Dec 20, 2017
LICENSE Update Dec 20, 2017
hcd Update hcd Dec 20, 2017

hcd : Health Care Daemon for docker

A lightweight process for managing unhealthy docker containers


Docker added recently support for health checks but unfortunatly the docker daemon cannot (yet?) restart containers in an unhealthy state.

This is the purpose of this container.

The image size is only 13MB and memory footprint is kept low (less than 1MB).


By default, hcd monitor all your running containers and will restart any unhealthy container.

Run the hcd container with the following command:

docker run -d --name hcd \
-v /var/run/docker.sock:/var/run/docker.sock \

Or if you prefer to use a docker-compose file:

version: "2"
    image: himred/hcd:latest
    restart: always
    container_name: hcd
      - "/var/run/docker.sock:/var/run/docker.sock"


By default, hcd run the checks every 60 seconds.
If you want to change this interval, you must define the variable INTERVAL.
For example, this will start hcd with an interval of 30 seconds:

docker run -d --name hcd -e INTERVAL=30 \
-v /var/run/docker.sock:/var/run/docker.sock \

Of course, you can define this in your docker-compose.yml file as well.


hcd use the com.himred.hcd label to customize the behavior container per container.
By default, any unhealthy container will be restarted, unless it has the label com.himred.hcd
If a container has the label com.himred.hcd, hcd behavior will be the following:

Label value behavior
com.himred.hcd ignore When unhealthy, hcd will not restart the container
com.himred.hcd stop When unhealthy, hcd will stop the container
com.himred.hcd start file.yml When unhealthy, hcd will stop the container and run docker-compose up -d on the file provided (the file is searched in the /hcd directory).
Bind /hcd to your host and create yml files to use this feature.
This is useful to start a backup service when main service is unhealthy


hcd output all it's logs to stdout.

You can’t perform that action at this time.