Dropping container with RabbitMQ in Docker Dropping container with RabbitMQ in Docker docker docker

Dropping container with RabbitMQ in Docker


You should use the following environment varibles:

DEFAULT_VHOST=/DEFAULT_USER=user1DEFAULT_PASS=pass1

see https://www.rabbitmq.com/configure.html for more information.

Or use other versions of rabbitMQ like 3.8:

rabbitmq:3.8-management


The line

image: "rabbitmq:3-management"

Basically (I think) gets the latest stable version of Rabbit, which is 3.9, which has deprecated those variables. If you wish to keep using the latest version of rabbit, you must use a configuration file. Seeing as how you've probably been using 3.8 up until this point, I imagine that's more work than it's worth. You can use 3.8 instead by changing the line to:

image: "rabbitmq:3.8-management"

The variables are not deprecated in this version and will not throw those errors.


The latest stable docker image for RabbitMQ (3.9) has been recently updated and the official image page says:

As of RabbitMQ 3.9, all of the docker-specific variables listed below are deprecated and no longer used.

I have resolved the issue in following way:

  1. Create a rabbitmq.conf file in the same folder where docker composefile is present

  2. Put the variables in there following guidelines and naming convention from here. Something like:

    default_vhost = /default_user = userdefault_pass = bitnami
  3. In docker compose file, instead of an environment section put a volumes section and mounted the rabbitmq.conf file to proper path (depending on OS, follow here). For linux container it will be like:

    rabbit:    image: "rabbitmq:3-management"    hostname: "rabbit"    volumes:      - "./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf"    ports:      - "15672:15672"      - "5672:5672"    labels:      NAME: "rabbitmq"        networks:      - postgres