faigy langsam
faigy langsam

Reputation: 2176

Ping until docker is up or until timeout

I am running an app on a docker container,
my app runs on http://127.0.0.1:8080/
once the app is up - (not once the container is running, once the app is ready to use) i want to run the tests,
If it takes the app more than a minute to run i want to print an error and exit.
How can i ping to the app until it's up or until the timeout past?

Upvotes: 1

Views: 672

Answers (1)

WasteD
WasteD

Reputation: 778

You can use netcat. You can check if a service is online on a specific port for example: nc -w 5 -z 127.0.0.1 8080

Added my comment as answer now.

Upvotes: 2

Related Questions