Utility to wait for the following cases:
- wait for a TCP port to get open
- wait for an HTTP status code
- wait for a Docker container to get healthy
- ... more to come
Download the latest binary from the releases.
go get github.com/jordyv/wait-for
docker pull jordyversmissen/wait-for
$ docker run -v /var/run/docker.sock:/var/run/docker.sock:ro docker-healthcheck jordyversmissen/wait-for test_container
$ docker run jordyversmissen/wait-for tcp hostname 1234
$ docker run jordyversmissen/wait-for http google.com
$ wait-for
Wait for
Examples:
wait-for tcp localhost 8080 Wait till TCP port 8080 at localhost gets up
wait-for http localhost 8080 Wait till http://localhost:8080 returns 200
wait-for docker-healthcheck mysql Wait the Docker healthcheck for container 'mysql' returns healthy
Usage:
wait-for [command]
Available Commands:
docker-healthcheck Wait for a Docker container to get healthy
help Help about any command
http Wait for an HTTP connection
tcp Wait for TCP connection
Flags:
-h, --help help for wait-for
-t, --timeout duration Timeout (default 10s)
-v, --verbose Verbose output
Use "wait-for [command] --help" for more information about a command.