I have just started learning RabbitMQ and Docker/Fig. I have a very simple example with 3 fig containers, one each for the Rabbit Server, Producer, and Consumer. In /etc/hosts I have set my boot2docker ip to an alias of dockerhost:

/etc/hosts
192.168.59.103 dockerhost

When I fig up -d the RabbitMQ server, everything works as it should; I can open a browser and go to dockerhost:PORTNUM and access the RabbitMQ control panel.

One Solution collect form web for “Docker/Boot2Docker/Fig + RabbitMQ host issue; pika.exceptions.AMQPConnectionError: [Errno -2] Name or service not known”

As you are using fig, I suggest you use the real power of fig by creating 1 unique fig.yml file and link the containers for them to communicate. So you would edit your current RabbitMQ producer fig.yml so you get: