Introducing our new CEO Don Johnson - Read More

bitnami/rabbitmq

Verified Publisher

By VMware

Updated 1 day ago

Bitnami container image for RabbitMQ

Image
Integration & Delivery
Message Queues
Security
126

500M+

Bitnami package for RabbitMQ

What is RabbitMQ?

RabbitMQ is an open source general-purpose message broker that is designed for consistent, highly-available messaging scenarios (both synchronous and asynchronous).

Overview of RabbitMQ Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.

TL;DR

docker run --name rabbitmq bitnami/rabbitmq:latest

You can find the default credentials and available configuration options in the Environment Variables section.

Why use Bitnami Images?

  • Bitnami closely tracks upstream source changes and promptly publishes new versions of this image using our automated systems.
  • With Bitnami images the latest bug fixes and features are available as soon as possible.
  • Bitnami containers, virtual machines and cloud images use the same components and configuration approach - making it easy to switch between formats based on your project needs.
  • All our images are based on minideb -a minimalist Debian based container image that gives you a small base container image and the familiarity of a leading Linux distribution- or scratch -an explicitly empty image-.
  • All Bitnami images available in Docker Hub are signed with Notation. Check this post to know how to verify the integrity of the images.
  • Bitnami container images are released on a regular basis with the latest distribution packages available.

Looking to use RabbitMQ in production? Try VMware Tanzu Application Catalog, the commercial edition of the Bitnami catalog.

How to deploy RabbitMQ in Kubernetes?

Deploying Bitnami applications as Helm Charts is the easiest way to get started with our applications on Kubernetes. Read more about the installation in the Bitnami RabbitMQ Chart GitHub repository.

Bitnami containers can be used with Kubeapps for deployment and management of Helm Charts in clusters.

Why use a non-root container?

Non-root container images add an extra layer of security and are generally recommended for production environments. However, because they run as a non-root user, privileged tasks are typically off-limits. Learn more about non-root containers in our docs.

Supported tags and respective Dockerfile links

Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags in our documentation page.

You can see the equivalence between the different tags by taking a look at the tags-info.yaml file present in the branch folder, i.e bitnami/ASSET/BRANCH/DISTRO/tags-info.yaml.

Subscribe to project updates by watching the bitnami/containers GitHub repo.

Get this image

The recommended way to get the Bitnami RabbitMQ Docker Image is to pull the prebuilt image from the Docker Hub Registry.

docker pull bitnami/rabbitmq:latest

To use a specific version, you can pull a versioned tag. You can view the list of available versions in the Docker Hub Registry.

docker pull bitnami/rabbitmq:[TAG]

If you wish, you can also build the image yourself by cloning the repository, changing to the directory containing the Dockerfile and executing the docker build command. Remember to replace the APP, VERSION and OPERATING-SYSTEM path placeholders in the example command below with the correct values.

git clone https://github.com/bitnami/containers.git
cd bitnami/APP/VERSION/OPERATING-SYSTEM
docker build -t bitnami/APP:latest .

Persisting your application

If you remove the container all your data will be lost, and the next time you run the image the database will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed.

For persistence you should mount a directory at the /bitnami/rabbitmq/mnesia path. If the mounted directory is empty, it will be initialized on the first run.

docker run \
    -v /path/to/rabbitmq-persistence:/bitnami/rabbitmq/mnesia \
    bitnami/rabbitmq:latest

NOTE: As this is a non-root container, the mounted files and directories must have the proper permissions for the UID 1001.

Connecting to other containers

Using Docker container networking, a RabbitMQ server running inside a container can easily be accessed by your application containers.

Containers attached to the same network can communicate with each other using the container name as the hostname.

Using the Command Line

In this example, we will create a RabbitMQ client instance that will connect to the server instance that is running on the same docker network as the client.

Step 1: Create a network

docker network create app-tier --driver bridge

Step 2: Launch the RabbitMQ server instance

Use the --network app-tier argument to the docker run command to attach the RabbitMQ container to the app-tier network.

docker run -d --name rabbitmq-server \
    --network app-tier \
    bitnami/rabbitmq:latest

Step 3: Launch your RabbitMQ client instance

Finally we create a new container instance to launch the RabbitMQ client and connect to the server created in the previous step:

docker run -it --rm \
    --network app-tier \
    bitnami/rabbitmq:latest rabbitmqctl -n rabbit@rabbitmq-server status
Using a Docker Compose file

When not specified, Docker Compose automatically sets up a new network and attaches all deployed services to that network. However, we will explicitly define a new bridge network named app-tier. In this example we assume that you want to connect to the RabbitMQ server from your own custom application image which is identified in the following snippet by the service name myapp.

version: '2'

networks:
  app-tier:
    driver: bridge

services:
  rabbitmq:
    image: 'bitnami/rabbitmq:latest'
    networks:
      - app-tier
  myapp:
    image: 'YOUR_APPLICATION_IMAGE'
    networks:
      - app-tier

IMPORTANT:

  1. Please update the YOUR_APPLICATION_IMAGE placeholder in the above snippet with your application image
  2. In your application container, use the hostname rabbitmq to connect to the RabbitMQ server

Launch the containers using:

docker-compose up -d

Configuration

Environment variables

Customizable environment variables

NameDescriptionDefault Value
RABBITMQ_CONF_FILERabbitMQ configuration file.${RABBITMQ_CONF_DIR}/rabbitmq.conf
RABBITMQ_DEFINITIONS_FILEWhether to load external RabbitMQ definitions. This is incompatible with setting the RabbitMQ password securely./app/load_definition.json
RABBITMQ_SECURE_PASSWORDWhether to set the RabbitMQ password securely. This is incompatible with loading external RabbitMQ definitions.no
RABBITMQ_CLUSTER_NODE_NAMERabbitMQ cluster node name. When specifying this, ensure you also specify a valid hostname as RabbitMQ will fail to start otherwise.nil
RABBITMQ_CLUSTER_PARTITION_HANDLINGRabbitMQ cluster partition recovery mechanism.ignore
RABBITMQ_DISK_FREE_RELATIVE_LIMITDisk relative free space limit of the partition on which RabbitMQ is storing data.1.0
RABBITMQ_DISK_FREE_ABSOLUTE_LIMITDisk absolute free space limit of the partition on which RabbitMQ is storing data (takes precedence over the relative limit).nil
RABBITMQ_ERL_COOKIEErlang cookie to determine whether different nodes are allowed to communicate with each other.nil
RABBITMQ_VM_MEMORY_HIGH_WATERMARKHigh memory watermark for RabbitMQ to block publishers and prevent new messages from being enqueued. Can be specified as an absolute or relative value (as percentage or value between 0 and 1).nil
RABBITMQ_LOAD_DEFINITIONSWhether to load external RabbitMQ definitions. This is incompatible with setting the RabbitMQ password securely.no
RABBITMQ_MANAGEMENT_BIND_IPRabbitMQ management server bind IP address.0.0.0.0
RABBITMQ_MANAGEMENT_PORT_NUMBERRabbitMQ management server port number.15672
RABBITMQ_MANAGEMENT_ALLOW_WEB_ACCESSAllow web access to RabbitMQ management portal for RABBITMQ_USERNAMEfalse
RABBITMQ_NODE_NAMERabbitMQ node name.rabbit@localhost
RABBITMQ_USE_LONGNAMEWhether to use fully qualified names to identify nodesfalse
RABBITMQ_NODE_PORT_NUMBERRabbitMQ node port number.5672
RABBITMQ_NODE_TYPERabbitMQ node type.stats
RABBITMQ_VHOSTRabbitMQ vhost./
RABBITMQ_VHOSTSList of additional virtual host (vhost).nil
RABBITMQ_CLUSTER_REBALANCERebalance the RabbitMQ Cluster.false
RABBITMQ_CLUSTER_REBALANCE_ATTEMPTSMax attempts for the rebalance check to run100
RABBITMQ_USERNAMERabbitMQ user name.user
RABBITMQ_PASSWORDRabbitMQ user password.bitnami
RABBITMQ_FORCE_BOOTForce a node to start even if it was not the last to shut downno
RABBITMQ_ENABLE_LDAPEnable the LDAP configuration.no
RABBITMQ_LDAP_TLSEnable secure LDAP configuration.no
RABBITMQ_LDAP_SERVERSComma, semi-colon or space separated list of LDAP server hostnames.nil
RABBITMQ_LDAP_SERVERS_PORTLDAP servers port.389
RABBITMQ_LDAP_USER_DN_PATTERNDN used to bind to LDAP in the form cn=$${username},dc=example,dc=org.nil
RABBITMQ_NODE_SSL_PORT_NUMBERRabbitMQ node port number for SSL connections.5671
RABBITMQ_SSL_CACERTFILEPath to the RabbitMQ server SSL CA certificate file.nil
RABBITMQ_SSL_CERTFILEPath to the RabbitMQ server SSL certificate file.nil
RABBITMQ_SSL_KEYFILEPath to the RabbitMQ server SSL certificate key file.nil
RABBITMQ_SSL_DEPTHMaximum number of non-self-issued intermediate certificates that may follow the peer certificate in a valid certification path.nil
RABBITMQ_SSL_FAIL_IF_NO_PEER_CERTWhether to reject TLS connections if client fails to provide a certificate.no
RABBITMQ_SSL_VERIFYWhether to enable peer SSL certificate verification. Valid values: verify_none, verify_peer.verify_none
RABBITMQ_MANAGEMENT_SSL_PORT_NUMBERRabbitMQ management server port number for SSL/TLS connections.15671
RABBITMQ_MANAGEMENT_SSL_CACERTFILEPath to the RabbitMQ management server SSL CA certificate file.$RABBITMQ_SSL_CACERTFILE
RABBITMQ_MANAGEMENT_SSL_CERTFILEPath to the RabbitMQ server SSL certificate file.$RABBITMQ_SSL_CERTFILE
RABBITMQ_MANAGEMENT_SSL_KEYFILEPath to the RabbitMQ management server SSL certificate key file.$RABBITMQ_SSL_KEYFILE
RABBITMQ_MANAGEMENT_SSL_DEPTHMaximum number of non-self-issued intermediate certificates that may follow the peer certificate in a valid certification path, for the RabbitMQ management server.nil
RABBITMQ_MANAGEMENT_SSL_FAIL_IF_NO_PEER_CERTWhether to reject TLS connections if client fails to provide a certificate for the RabbitMQ management server.yes
RABBITMQ_MANAGEMENT_SSL_VERIFYWhether to enable peer SSL certificate verification for the RabbitMQ management server. Valid values: verify_none, verify_peer.verify_peer

Read-only environment variables

NameDescriptionValue
RABBITMQ_VOLUME_DIRPersistence base directory./bitnami/rabbitmq
RABBITMQ_BASE_DIRRabbitMQ installation directory./opt/bitnami/rabbitmq
RABBITMQ_BIN_DIRRabbitMQ executables directory.${RABBITMQ_BASE_DIR}/sbin
RABBITMQ_DATA_DIRRabbitMQ data directory.${RABBITMQ_VOLUME_DIR}/mnesia
RABBITMQ_CONF_DIRRabbitMQ configuration directory.${RABBITMQ_BASE_DIR}/etc/rabbitmq
RABBITMQ_DEFAULT_CONF_DIRRabbitMQ default configuration directory.${RABBITMQ_BASE_DIR}/etc/rabbitmq.default
RABBITMQ_CONF_ENV_FILERabbitMQ configuration file for environment variables.${RABBITMQ_CONF_DIR}/rabbitmq-env.conf
RABBITMQ_HOME_DIRRabbitMQ home directory.${RABBITMQ_BASE_DIR}/.rabbitmq
RABBITMQ_LIB_DIRRabbitMQ lib directory.${RABBITMQ_BASE_DIR}/var/lib/rabbitmq
RABBITMQ_INITSCRIPTS_DIRRabbitMQ init scripts directory./docker-entrypoint-initdb.d
RABBITMQ_LOGS_DIRRabbitMQ logs directory.${RABBITMQ_BASE_DIR}/var/log/rabbitmq
RABBITMQ_PLUGINS_DIRRabbitMQ plugins directory.${RABBITMQ_BASE_DIR}/plugins
RABBITMQ_MOUNTED_CONF_DIRRabbitMQ directory for mounted configuration files.${RABBITMQ_VOLUME_DIR}/conf
RABBITMQ_DAEMON_USERRabbitMQ system user name.rabbitmq
RABBITMQ_DAEMON_GROUPRabbitMQ system user group.rabbitmq
RABBITMQ_MNESIA_BASEPath to RabbitMQ mnesia directory.$RABBITMQ_DATA_DIR
RABBITMQ_COMBINED_CERT_PATHPath to the RabbitMQ server SSL certificate key file.${RABBITMQ_COMBINED_CERT_PATH:-/tmp/rabbitmq_combined_keys.pem}

When you start the rabbitmq image, you can adjust the configuration of the instance by passing one or more environment variables either on the docker-compose file or on the docker run command line. If you want to add a new environment variable:

  • For docker-compose add the variable name and value under the application section in the docker-compose.yml file present in this repository: :
rabbitmq:
  ...
  environment:
    - RABBITMQ_PASSWORD=my_password
  ...
  • For manual execution add a -e option with each variable and value.
Setting up a cluster

Using Docker Compose

This is the simplest way to run RabbitMQ with clustering configuration:

Step 1: Add a stats node in your docker-compose.yml

Copy the snippet below into your docker-compose.yml to add a RabbitMQ stats node to your cluster configuration.

version: '2'

services:
  stats:
    image: bitnami/rabbitmq
    environment:
      - RABBITMQ_NODE_TYPE=stats
      - RABBITMQ_NODE_NAME=rabbit@stats
      - RABBITMQ_ERL_COOKIE=s3cr3tc00ki3
    ports:
      - '15672:15672'
    volumes:
      - 'rabbitmqstats_data:/bitnami/rabbitmq/mnesia'

Note: The name of the service (stats) is important so that a node could resolve the hostname to cluster with. (Note that the node name is rabbit@stats)

Step 2: Add a queue node in your configuration

Update the definitions for nodes you want your RabbitMQ stats node cluster with.

  queue-disc1:
    image: bitnami/rabbitmq
    environment:
      - RABBITMQ_NODE_TYPE=queue

_Note: the README for this container is longer than the DockerHub length limit of 25000, so it has been trimmed. The full README can be found at https://github.com/bitnami/containers/blob/main/bitnami/rabbitmq/README.md_

Docker Pull Command

docker pull bitnami/rabbitmq
Bitnami