Add "rabbitmq"

This commit is contained in:
Tianon Gravi 2016-06-13 15:02:06 -07:00
parent 8baa66d8ee
commit d7ffc52ddf
2 changed files with 18 additions and 0 deletions

5
rabbitmq/Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM rabbitmq
COPY docker-healthcheck /usr/local/bin/
HEALTHCHECK CMD ["docker-healthcheck"]

13
rabbitmq/docker-healthcheck Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -eo pipefail
host="$(hostname --short || echo 'localhost')"
export RABBITMQ_NODENAME="${RABBITMQ_NODENAME:-"rabbit@$host"}"
if rabbitmqctl status; then
exit 0
fi
# If the probe returns 2 ("starting") when the container has already moved out of the "starting" state then it is treated as "unhealthy" instead.
# https://github.com/docker/docker/blob/dcc65376bac8e73bb5930fce4cddc2350bb7baa2/docs/reference/builder.md#healthcheck
exit 2