如何从主机 MacOS 机器连接到 docker 容器上的服务 运行?
How to connect to a service running on docker container from withing host MacOS machine?
我正在尝试在 docker 机器上的 Docker 上安装 Hadoop。长话短说,我需要能够 curl 172.17.0.1:8500
。
在虚拟机中运行良好,但在 MacOS 中失败。
curl: (7) Failed connect to 172.17.0.1:8500; Operation timed out
我应该怎么做才能解决这个问题?
来自 sequenceiq/docker-ambari
的 Krisztian Horvath 非常友好地帮助我解决了这个问题。
那么,你需要做的就是
docker-machine ip default
获取VM_IP
你的虚拟机IP然后
sudo route add -net 172.17.0.0/16 VM_IP
我正在尝试在 docker 机器上的 Docker 上安装 Hadoop。长话短说,我需要能够 curl 172.17.0.1:8500
。
在虚拟机中运行良好,但在 MacOS 中失败。
curl: (7) Failed connect to 172.17.0.1:8500; Operation timed out
我应该怎么做才能解决这个问题?
来自 sequenceiq/docker-ambari
的 Krisztian Horvath 非常友好地帮助我解决了这个问题。
那么,你需要做的就是
docker-machine ip default
获取VM_IP
你的虚拟机IP然后
sudo route add -net 172.17.0.0/16 VM_IP