Sami Salim Khan
unread,May 15, 2023, 7:52:23 AM5/15/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rabbitmq-users
Hi all,
i am using Rabbit-MQ as a service in a docker container via docker-compose.yml.
Here is the snippet:
version: "3.6"
services:
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
- RABBITMQ_DEFAULT_USER=user
- RABBITMQ_DEFAULT_PASS=password
volumes:
- ./docker-conf/rabbitmq/data/:/var/lib/rabbitmq/
- ./docker-conf/rabbitmq/log/:/var/log/rabbitmq
networks:
- local
networks:
local:
volumes:
postgres_data:
driver: local
When running the docker-compose up command, a linux container is being created and the
rabbitmq:3-management-alpine image is downloaded and imported as image. However, after a few seconds i always get the error message "Cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only" and teh service is stopped. Even a manual start stops it imediately.
After searching in the internet and also here in this group, i tried to solve the problem by adding the following line to the service configuration:
command: sh -c "chown supervisor:supervisor /var/lib/rabbitmq/.erlang.cookie && chmod 600 /var/lib/rabbitmq/.erlang.cookie"
This causes the service to stop imediately too and shows no log at all!
I am using Docker Desktop for Windows to check the Docker container.
Does anyone have the same problem and have you got a functioning solution for it? Please let me know. Thank you very much in advance.
BR
Sami