0

I started a rabbitmq docker container as described here https://registry.hub.docker.com/_/rabbitmq/

$ sudo docker run -d --hostname myrabbit --name rabbit rabbitmq:3

Then I got the docker container's IP like so:

$ sudo docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' rabbit
172.17.0.2

Then try to connect to rabbit with telnet like so:

$ telnet 172.17.0.2 4369

But I get this output:

Trying 172.17.0.2...
telnet: connect to address 172.17.0.2: Network is unreachable
telnet: Unable to connect to remote host

I tried port 5672 also with the same result. What am I doing wrong?

Red Cricket
  • 470
  • 2
  • 8
  • 21

1 Answers1

1

I wasn't executing docker run ... correctly. I needed to use the -p option like so:

docker run -d --hostname my-rabbit --name some-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management

Then I can point my browser to http://localhost:15672 and everything works.

Red Cricket
  • 470
  • 2
  • 8
  • 21