Restart your unhealthy containers safely
deunhealth.restart.on.unhealthy=true labelamd64, 386, arm64, arm32v7, arm32v6, ppc64le, s390x and riscv64 CPU architecturesUse the following command:
docker run -d --network none -v /var/run/docker.sock:/var/run/docker.sock qmcgaw/deunhealth
You can also use docker-compose.yml with:
docker-compose up -d
Set labels on containers:
deunhealth.restart.on.unhealthy=trueYou 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 variable | Flag | Default | Possible values | Description |
|---|---|---|---|---|
DOCKER_HOST | --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 | --log-level | info | debug, info, warning, error | Logging level |
HEALTH_SERVER_ADDRESS | --health-server-address | 127.0.0.1:9999 | Valid address | Internal health http server listening address. Nothing to do with restarting unhealthy containers. |
TZ | N/A | America/Montreal | string | Timezone |
Please refer to the corresponding readme.
Install Go dependencies with
go mod download
Install golangci-lint
You might want to use an editor such as Visual Studio Code with the Go extension.
# 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.
Content type
Image
Digest
sha256:db1e4fcd3…
Size
3.1 MB
Last updated
7 months ago
docker pull qmcgaw/deunhealth