I am trying to start RMQ inside docker container, with precreated queue qwer
.
Prior to this, I was using simple docker-compose.yml
file:
rabbit:
image: rabbitmq:management-alpine
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
And it worked fine, except that it has no queues pre-created at start.
Now I've switched to custom image, with following Dockerfile
:
FROM rabbitmq:management-alpine
ADD rabbitmq.conf /etc/rabbitmq/
ADD definitions.json /etc/rabbitmq/
RUN chown rabbitmq:rabbitmq /etc/rabbitmq/rabbitmq.conf /etc/rabbitmq/definitions.json
where rabbitmq.conf
is v3.7+ sysctl-styled config, with line:
management.load_definitions = /etc/rabbitmq/definitions.json
and definitions.json
contains attempt to create queue:
{
"vhosts":[
{"name":"/"}
],
"queues":[
{"name":"qwer","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}
]
}
Now it started to refuse login:
Error on AMQP connection <0.660.0> (172.18.0.6:48916 -> 172.18.0.10:5672, state: starting):
PLAIN login refused: user 'guest' - invalid credentials
I thought that the task is somewhat simple, but configuration process of rabbit itself is most complex task, and documentation is somewhat unclear.
I was unable to figure out how should it work, even after 4 days of trials and googling..
Could you help me, how to write configuration file, in order to create a queue and preserve ability to connect and talk to it?