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?
I wasn't executing
docker run ...
correctly. I needed to use the-p
option like so:Then I can point my browser to http://localhost:15672 and everything works.