Docker Community Forums

Share and learn in the Docker community.

Converting workflow to docker-compose doesn't work out (RabbitMQ)

(Eewids) #1


at first, I really tried a lot and read a lot and I’m starting feeling dump. Probably it is easy to get it working, but I didn’t so far and I hope you may can help me…

System: Arch Linux
Docker: 18.02.0-ce
Docker-compose: 1.20.0

I want to play around with RabbitMQ. It is working locally (=without docker), it is working when using --net=host for every container, but it is not working as soon as I try to convert this into a docker-compose file.

I have three services: the RabbitMQ server, one send-client (producer) and a receiving client (consumer). The Clients seem to connect to the Server, because you can see the connection in the logs (like “accepting AMQP connection” and “user ‘guest’ authenticated and granted access to vhost ‘/’”). But still the information didn’t get there, that is to say the sender breaks, the receiver never gets any message.

My docker-compose.yml look like this:

version: "3"

       image: rabbitmq
       network_mode: host

       build: rabbit-recv
       network_mode: host
          - rabbit-server

       build: rabbit-send
       network_mode: host
          - rabbit-recv

The clients look like described in the RabbitMQ-Tutorial.

Do you have any idea, what’s going on here? It feels like there is a big elephant I don’t see…

Kind regards

(King Chung Huang) #2

What are the docker commands you’re using to run the three containers? If you are able to make it work with docker run … commands, they should equally work when defined using a Compose file, assuming everything’s translated over correctly.

(Eewids) #3


well it is bascially:

docker run -ti --net=host rabbitmq
docker run -ti --net=host rabbit-recv #build before
docker run -ti --net=host rabbit-send #build before

Any idea?

Generally I can only start RabbitMQ container after switching off connection to my router (no matter if LAN or WiFi). Otherwise I get ERROR: epmd error for host myhostname: address (cannot connect to host/port). May this is connected?

Kind regards

(Eewids) #4

Just my stupidity…

rabbitmq needs one or both of

tty: true
stdin_open: true

Kind regards