Files
docker-autoheal/README.md
T
will Farrell 11d4d0eb22 init commit
2017-02-11 19:19:32 -07:00

1.2 KiB

docker-autoheal

Monitor and restart unhealthy docker containers.

How to use

a) Apply the label autoheal=true to your container to have it watched.

b) Set ENV AUTOHEAL_CONTAINER_LABEL=all to watch all running containers.

c) Set ENV AUTOHEAL_CONTAINER_LABEL to existing label name that has the value true.

Note: You must apply HEALTHCHECK to your docker images first. See https://docs.docker.com/engine/reference/builder/#/healthcheck for details.

ENV Defaults

AUTOHEAL_CONTAINER_LABEL=autoheal
AUTOHEAL_INTERVAL=5

Testing

docker build -t autoheal .

docker run -d \
    -e AUTOHEAL_CONTAINER_LABEL=all \
    -v /var/run/docker.sock:/tmp/docker.sock \
    autoheal