Skip to content

Latest commit

 

History

History
89 lines (60 loc) · 5.04 KB

README.md

File metadata and controls

89 lines (60 loc) · 5.04 KB

alpine-rabbitmq

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.

Features

This image features:

Versions

See VERSIONS.md for image contents.

Usage

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.

Configuration

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 the tcp_listeners configuration.
  • RABBITMQ_SSL_LISTENERS to configure the ssl_listeners configuration.
  • RABBITMQ_SSL_CERT_FILE, RABBITMQ_SSL_KEY_FILE and RABBITMQ_SSL_CA_FILE to configure via the ssl_options configuration.
  • RABBITMQ_SSL_DEPTH to configure the ssl_options.depth configuration.
  • RABBITMQ_SSL_VERIFY to customise the ssl_options.verify configuration; defaults to verify_peer.
  • RABBITMQ_SSL_FAIL to customise the ssl_options.fail_if_no_peer_cert configuration; defaults to true.
  • RABBITMQ_DEFAULT_VHOST to configure the default_vhost configuration.
  • RABBITMQ_USER and RABBITMQ_PASS to configure the default_user and default_pass configurations.
  • RABBITMQ_LOOPBACK_USERS to configure the loopback_users configuration.
  • RABBITMQ_ENABLE_MANAGEMENT_PLUGIN to enable the rabbitmq_management configuration. Set to true.
  • RABBITMQ_MGMT_SSL_CERT_FILE, RABBITMQ_MGMT_SSL_KEY_FILE and RABBITMQ_MGMT_SSL_CA_FILE to configure the rabbitmq_management.ssl_opts configuration.
  • RABBITMQ_MGMT_PORT to enable the rabbitmq_management.port configuration; defaults to 15672.

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.

RabbitMQ Management Plugin

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.

Run RabbitMQ server

You can start up your RabbitMQ server using the following command:

docker run -d -p 5672:5672 -p 15672:15672 smebberson/alpine-rabbitmq

Run RabbitMQ server with persistent shared directories

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.

Example

An example of using this image can be found in examples/user-rabbitmq.