Please note this image is using Alpine's Erlang packages which are in its community repo.
A Docker image for running RabbitMQ, based on Alpine Linux. This image belongs to a suite of images documented here.
This image features:
2.1.1
,latest
(Dockerfile)2.1.0
(Dockerfile)2.0.0
(Dockerfile)1.0.0
(Dockerfile)
See VERSIONS.md for image contents.
To use this image include FROM smebberson/alpine-rabbitmq
at the top of your Dockerfile
. Inheriting from smebberson/alpine-rabbitmq
provides you with the ability to easily start your RabbitMQ server using s6. s6 will monitor it for you. The container will restart if RabbitMQ were to fail.
This comes with confd
and is used to provide easy configuration. Please note, not all RabbitMQ configuration options are supported. Please submit a pull request if you require an option, or copy the template from here to your container and alter as necessary.
Basic configuration via a few environment variables have been baked into this image.
RABBITMQ_TCP_LISTENERS
to configure thetcp_listeners
configuration.RABBITMQ_SSL_LISTENERS
to configure thessl_listeners
configuration.RABBITMQ_SSL_CERT_FILE
,RABBITMQ_SSL_KEY_FILE
andRABBITMQ_SSL_CA_FILE
to configure via thessl_options
configuration.RABBITMQ_SSL_DEPTH
to configure thessl_options.depth
configuration.RABBITMQ_SSL_VERIFY
to customise thessl_options.verify
configuration; defaults toverify_peer
.RABBITMQ_SSL_FAIL
to customise thessl_options.fail_if_no_peer_cert
configuration; defaults totrue
.RABBITMQ_DEFAULT_VHOST
to configure thedefault_vhost
configuration.RABBITMQ_USER
andRABBITMQ_PASS
to configure thedefault_user
anddefault_pass
configurations.RABBITMQ_LOOPBACK_USERS
to configure theloopback_users
configuration.RABBITMQ_ENABLE_MANAGEMENT_PLUGIN
to enable therabbitmq_management
configuration. Set totrue
.RABBITMQ_MGMT_SSL_CERT_FILE
,RABBITMQ_MGMT_SSL_KEY_FILE
andRABBITMQ_MGMT_SSL_CA_FILE
to configure therabbitmq_management.ssl_opts
configuration.RABBITMQ_MGMT_PORT
to enable therabbitmq_management.port
configuration; defaults to15672
.
You can completely update the configuration by replacing /etc/confd/templates/rabbitmq.tmpl
with a variation of your own.
Only ports 5672/tcp 15672/tcp are exposed.
The RabbitMQ management plugin is disabled by default, however, it's quite simple to enable. Add an environment of RABBITMQ_ENABLE_MANAGEMENT_PLUGIN
(set to true
). This will enable the management plugin, with the default configuration.
If the RABBITMQ_SSL_CERT_FILE
, RABBITMQ_SSL_KEY_FILE
and RABBITMQ_SSL_CA_FILE
environment variables are defined, they'll be used to automatically enable SSL for the management plugin UI. If you'd like to have a different set of SSL certificates for the management plugin, you can do so by setting the following environment variables RABBITMQ_MGMT_SSL_CERT_FILE
, RABBITMQ_MGMT_SSL_KEY_FILE
and RABBITMQ_MGMT_SSL_CA_FILE
.
You can access the management UI admin via http(s)://server-name:15672. For more info see RabbitMQ documentations.
You can start up your RabbitMQ server using the following command:
docker run -d -p 5672:5672 -p 15672:15672 smebberson/alpine-rabbitmq
docker run -d -p 5672:5672 -p 15672:15672 -v <log-dir>:/data/log -v <data-dir>:/data/mnesia smebberson/alpine-rabbitmq
Please note: To utilise the persistent shared directories, please make sure you have included the VOLUME
command in your Dockerfile
and environment variables as defined in the configurations outlined above.
An example of using this image can be found in examples/user-rabbitmq.