Rabbitmq: queues are deleted when docker container is deleted

Created on 3 Mar 2020  路  2Comments  路  Source: docker-library/rabbitmq

Hi, there is my docker-compose.yml:

#

version: '2'
services:
rabbitmq:
image: 'rabbitmq:3.7.7-management'
restart: always
container_name: 'rabbitmq'
mem_limit: 1g
ports:
- '15673:15672'
env_file: ./rabbitmq.env
volumes:
- '/data/docker/public/rabbitmq/:/var/lib/rabbitmq/'
network_mode: 'bridge'

#

I created some durable queues, then deleted this container: 'docker rm -f rabbitmq', recreated a new container: 'docker-compose up -d rabbitmq', but the previous queues disappeared. Is there something wrong? I've set persistent volume, and the volume data are updated too, but why the queues can not be seen?

question

Most helpful comment

If you look in /data/docker/public/rabbitmq you'll find multiple rabbit@[host] folders as Rabbitmq uses the hostname as part of the folder name

https://github.com/docker-library/rabbitmq/issues/106#issuecomment-241882358
So specifying a hostname with --hostname or hostname: in the docker-compose file would resolve that

All 2 comments

If you look in /data/docker/public/rabbitmq you'll find multiple rabbit@[host] folders as Rabbitmq uses the hostname as part of the folder name

https://github.com/docker-library/rabbitmq/issues/106#issuecomment-241882358
So specifying a hostname with --hostname or hostname: in the docker-compose file would resolve that

@wglambert Thanks a lot, it works.

Was this page helpful?
0 / 5 - 0 ratings