无法在Windows版Docker上访问RabbitMQ

时间:2018-07-04 10:14:20

标签: docker rabbitmq

我敢肯定,这里的答案确实很明显,我想不起来了。我在Win 10 Pro机器上安装了Windows的Docker。 Windows计算机位于192.168.40 / 24网络上。

我按如下所示安装并安装RabbitMQ:

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

我可以看到它正在成功运行:

docker ps -a
CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS                    PORTS                                                 NAMES
3cabceeade6e        rabbitmq:3-management   "docker-entrypoint.s…"   7 minutes ago       Up 7 minutes              4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 25672/tcp   some-rabbit

但是我无法在127.0.0.1上远程登录到5671或15672。我还尝试过禁用Windows防火墙。

不确定如何关联,但Docker配置了以下网络设置:

enter image description here

编辑: IP地址信息是:

 "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "707c66b726b25c80abfebb1712d3bb0ae588dd77c996013bb528de7ac061edd4",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "15671/tcp": null,
                "15672/tcp": null,
                "25672/tcp": null,
                "4369/tcp": null,
                "5671/tcp": null,
                "5672/tcp": null
            },
            "SandboxKey": "/var/run/docker/netns/707c66b726b2",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "6e5ba9a4596967d98def608e18c9fd925a6ce036a84cd9d616f9f35d561ce68d",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "38f30e8dcf669b9419be3a03f1f296e0bed71d970516c4a1e581d37772bd1b55",
                    "EndpointID": "6e5ba9a4596967d98def608e18c9fd925a6ce036a84cd9d616f9f35d561ce68d",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02",
                    "DriverOpts": null
                }
            }
        }

那么我在这里错过了什么使我无法访问http://127.0.0.1:15672上的Web管理界面?我可以看到服务器正在172.17.0.2上运行,但显然不在我的网络上。

1 个答案:

答案 0 :(得分:4)

所以我终于弄明白了自己的愚蠢:

我在命令viz的上添加了端口:

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

而不是之前是容器的实际名称等。

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