Quiets the output to only announce when a port is ready for connection.
-s <interval_seconds>:
(Default: 1) specifies the number of seconds to sleep between rounds.
-t <timeout_seconds>:
(Default: 0) specifies the minimum number of seconds to run
before giving up and erroring out. If set to 0, no timeout is used and
wait4ports will wait forever.
Environment
Options can also be enabled via environment variables:
WAIT4PORTS_VERBOSE:
Verbosity is on by default, but setting this value to 0,
n[o], f[alse], orof[f] will disable
it.
WAIT4PORTS_SLEEP:
(Default: 1) specify the number of seconds to sleep between rounds.
WAIT4PORTS_TIMEOUT:
(Default: 0) specify the minimum number of seconds to run before
giving up and erroring out. If set to 0, no timeout is used and wait4ports
will wait forever.
erikogan/wait4ports
wait4ports
A small utility to wait for network peer availability. It polls each address and port, sleeping between runs.
Designed to be used in docker, specifically docker-compose, containers that need to wait for linked containers to be ready.
Hostname lookups and IPv6 are supported, and you can give each service your own name. Currently only TCP sockets are supported.
An AlpineLinux Package is available. (Currently in the
@edge
repository.)Options
-q
:-s <interval_seconds>
:-t <timeout_seconds>
:Environment
Options can also be enabled via environment variables:
WAIT4PORTS_VERBOSE
:0
,n[o]
,f[alse]
, orof[f]
will disable it.WAIT4PORTS_SLEEP
:WAIT4PORTS_TIMEOUT
:Usage
Example