To restart containers if they go unhealthy, use the label deunhealth.restart.on.unhealthy=true
You can update the image with docker pull qmcgaw/deunhealth:latest or use one of the tags available. ⚠️ You might want to use tagged images since latest will likely break compatibility until we reach a v1.0.0 release.
Environment variables
Environment variable
Default
Possible values
Description
DOCKER_HOST
Default Docker socket location
Docker host value
Docker host value such as unix:///var/run/docker.sock or tcp://socket-proxy:2375
LOG_LEVEL
info
debug, info, warning, error
Logging level
HEALTH_SERVER_ADDRESS
127.0.0.1:9999
Valid address
Health server listening address
TZ
America/Montreal
string
Timezone
Safety
The application doesn't need network to reduce the attack surface
Since Docker is written in Go, the program is also written in Go and uses the official Docker Go API
The Docker container is based on scratch to reduce the attack surface and only contains the static binary
# Build the binary
go build cmd/app/main.go
# Test the code
go test ./...
# Lint the code
golangci-lint run
# Build the Docker image
docker build -t qmcgaw/deunhealth .
See Contributing for more information on how to contribute to this repository.
TODOs
Trigger mechanism such that a container restart triggers other restarts
Inject pre-build binary doing a DNS lookup to containers labeled for it and that do not have a healthcheck built in (useful for scratch based images without healthcheck especially)