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?
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.
Most helpful comment
If you look in
/data/docker/public/rabbitmqyou'll find multiplerabbit@[host]folders as Rabbitmq uses the hostname as part of the folder namehttps://github.com/docker-library/rabbitmq/issues/106#issuecomment-241882358
So specifying a hostname with
--hostnameorhostname:in the docker-compose file would resolve that