Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arnested/healthy
Command healthy waits for Docker container(s) to become healthy.
https://github.com/arnested/healthy
docker docker-health-check hacktoberfest healthcheck tools
Last synced: about 2 months ago
JSON representation
Command healthy waits for Docker container(s) to become healthy.
- Host: GitHub
- URL: https://github.com/arnested/healthy
- Owner: arnested
- License: mit
- Created: 2018-09-04T20:12:37.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T05:41:15.000Z (9 months ago)
- Last Synced: 2024-04-12T13:24:03.920Z (9 months ago)
- Topics: docker, docker-health-check, hacktoberfest, healthcheck, tools
- Language: Go
- Homepage: https://hub.docker.com/r/arnested/healthy
- Size: 1.5 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
[![Docker image size](https://badgen.net/docker/size/arnested/healthy)](https://hub.docker.com/r/arnested/healthy)
[![CLA assistant](https://cla-assistant.io/readme/badge/arnested/go-healthy)](https://cla-assistant.io/arnested/go-healthy)
[![GoDoc](https://godoc.org/arnested.dk/go/healthy?status.svg)](https://pkg.go.dev/arnested.dk/go/healthy)# healthy
--
Command healthy waits for Docker container(s) to become healthy.The command takes one or more container ID's as argument(s) and will not exit
until all of them are reported "healthy" as it Health check status.A container with no health check defined is always considered healthy.
When all specified containers are reported healthy the command will exit with
return code 0.usage: healthy [flags] [container_id_or_name ...]
flags:
-fail-on-unhealthy
fail on unhealthy
-timeout duration
timeout after waiting (default 1h0m0s)In a docker-compose setup you could wait for all services to be healthy by
running:healthy $(docker-compose ps -q)
Or just could wait for the database service to be healthy by running:
healthy $(docker-compose ps -q database)
To wait no longer than one and half minute for containers to be healthy:
healthy -timeout 1m30s $(docker-compose ps -q)
You can also run healthy using a Docker image:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro arnested/healthy $(docker-compose ps -q)