I try to start a Docker container with RabbitMQ, as a result, the image is downloaded, but the container does not start. I get the following message in the logs:
error: RABBITMQ_DEFAULT_PASS is set but deprecated
error: RABBITMQ_DEFAULT_USER is set but deprecated
error: RABBITMQ_DEFAULT_VHOST is set but deprecated
error: RABBITMQ_ERLANG_COOKIE is set but deprecated
error: deprecated environment variables detected
This problem appeared recently, before that everything worked fine and started.
This is my docker-compose rabbit:
rabbit:
image: "rabbitmq:3-management"
hostname: "rabbit"
environment:
RABBITMQ_ERLANG_COOKIE: 'SWQOKODSQALRPCLNMEQGW'
RABBITMQ_DEFAULT_USER: 'user'
RABBITMQ_DEFAULT_PASS: 'bitnami'
RABBITMQ_DEFAULT_VHOST: '/'
ports:
- "15672:15672"
- "5672:5672"
labels:
NAME: "rabbitmq"
networks:
- postgres
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:
Create a rabbitmq.conf file in the same folder where docker compose file is present
Put the variables in there following guidelines and naming convention from here. Something like:
default_vhost = /
default_user = user
default_pass = bitnami
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With