A minimalistic AMQP server ping tool. It tries to ping the AMQP server, then exits with zero status. If the server isn't responding it exits with nonzero status after making a configured number of attempts.
This may be used as a stage image to get the statically linked binary from.
FROM argentoff/ocamqping as ocamqping
FROM other_base_image
RUN something important
WORKDIR /app
COPY --from=ocamqping /ocamqping /sbin/
COPY . .
RUN something also important$ git clone https://github.com/argent-smith/ocamqping.git
$ cd ocamqping
$ opam install -y .
ocamqping [OPTION]...
-
-P,--log-process(absentLOG_PROCESSenv) Whether to add process info (name & pid) to log messages. -
-T, --log-times (absent LOG_TIMES env) Whether to timestamp log messages.
-
--help[=FMT](default=auto) Show this help in format FMT. The value FMT must be one ofauto,pager,grofforplain. Withauto, the format ispagerorplainwhenever the TERM env var isdumbor undefined. -
-i VAL,--retry-interval=VAL(absent=1orOCAMQPING_RETRY_INTERVALenv) Ping retry interval in seconds -
-q,--quietBe quiet. Takes over--verbosity. -
-r VAL,--retry-count=VAL(absent=255orOCAMQPING_RETRY_COUNTenv) Ping retry count -
-u VAL,--amqp-uri=VAL(absent=amqp://localhost/orAMQP_URIenv) AMQP server URI -
--verbosity=LEVEL(absent=infoorLOG_VERBOSITYenv) Be more or less verbose. LEVEL must be one ofquiet,error,warning,infoordebug. -
--versionShow version information.
These environment variables affect the execution of ocamqping:
-
OCAMQPING_RETRY_COUNTSee option--retry-count. -
OCAMQPING_RETRY_INTERVAL— See option--retry-interval. -
AMQP_URI— See option--amqp-uri. -
LOG_PROCESS— See option--log-process. -
LOG_TIMES— See option--log-times. -
LOG_VERBOSITY- See option ----verbosity
Feel free to clone and contribute to this program.