Many other RabbitMQ Docker images are huge. Instead of using the bloated Ubuntu or Fedora images as a base, this image uses the 5MB Alpine Linux base image. Alpine lets us run RabbitMQ 3.5.4 on Erlang 18.0.2 in only 35MB!
The wrapper script starts RabbitMQ (with management plugin enabled), tails the log, and configures listeners on the standard ports:
5671/tcp
: Listening port when SSL is enabled5672/tcp
: Non-SSL default listening port15671/tcp
: SSL GUI listening port15672/tcp
: Non-SSL GUI listening port
RabbitMQ's data is persisted to a volume at /var/lib/rabbitmq
.
To enable SSL set the $SSL_CERT_FILE
, $SSL_KEY_FILE
, and $SSL_CA_FILE
environment variables. The wrapper script will use the same certs for GUI SSL access as for AMQPS access.
Example:
docker run -it \
--name rabbitmq \
-p 5671:5671 \
-p 15671:15671 \
-e SSL_CERT_FILE=/ssl/cert/cert.pem \
-e SSL_KEY_FILE=/ssl/cert/key.pem \
-e SSL_CA_FILE=/ssl/CA/cacert.pem \
gonkulatorlabs/rabbitmq
To set a custom config, ditch the wrapper script and call rabbitmq-server
directly. Place the custom config in /srv/rabbitmq_server-3.5.4/etc/rabbitmq/
.
Alpine's Erlang packages are in its edge
(testing) repo, if that bothers you then don't use this image!