[英]How to connect to a service running on docker container from withing host MacOS machine?
I am trying to install Hadoop on Docker on top of docker-machine. 我正在尝试在docker-machine上的Docker上安装Hadoop。 Long story short, I need to be able to
curl 172.17.0.1:8500
. 长话短说,我需要能够
curl 172.17.0.1:8500
。
That works just fine from within the Virtual Machine but fails from within MacOS. 在虚拟机中可以正常运行,但在MacOS内则无法运行。
curl: (7) Failed connect to 172.17.0.1:8500; Operation timed out
What should I do to go around this issue? 我应该怎么做才能解决这个问题?
Krisztian Horvath from sequenceiq/docker-ambari
was kind enough to help me out with that. 来自
sequenceiq/docker-ambari
Krisztian Horvath足够帮助我。
So, what you need to do is to 因此,您需要做的是
docker-machine ip default
to get VM_IP
your virtual machine IP and then 获取
VM_IP
您的虚拟机IP,然后
sudo route add -net 172.17.0.0/16 VM_IP
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.