Docktor is a little service that restarts unhealthy containers.
docker pull vterdunov/docktor
docker run -d --rm --name=docktor -v /var/run/docker.sock:/var/run/docker.sock:ro vterdunov/docktor
Docktor read environment variables
| Variable | Values | Description |
|---|---|---|
| BACKOFF_JITTER | bool | Enable/Disable backoff jitter. Default is: false |
| BACKOFF_MIN_TIME | int | Sets the minimum delay time between restart container. Deafult is: 3s |
| BACKOFF_MAX_TIME | int | Sets the maximum delay time between restart container. Default is: 30s |
| DOCKER_HOST | string | Sets a path to docker daemon socket. Can be a unix ot tcp socket (tcp://example.com:4243, unix:///var/run/docker.sock). Default is: unix:///var/run/docker.sock |
- Install Golang, Docker and dep
- Ensure that dependencies was installed:
make dep - Build docker container:
make build - Or single binary file:
make compile
docker run -d --rm --name=docktor -v /var/run/docker.sock:/var/run/docker.sock:ro docktor
docker-compose up [--build] [--scale unhealthy=NUM ]