在使用docker工具箱时,无法使用主机(Windows)IP访问Docker VM上的tomcat应用程序 [英] Not able to access tomcat application on Docker VM with host(windows) IP while using docker toolbox
问题描述
相反,我可以使用docker-machine ip访问tomcat应用程序,这是 http://192.168.99.100 :8888 。
但这不是我需要的。我需要通过网络从系统本身外部访问tomcat容器应用程序。那么,如何将tomcat应用程序映射到我的Windows主机系统?
在搜索周围,我可以看到boot2docker vm的端口转发选项。但是,再次我不使用boot2docker。我正在使用docker工具箱。
But this is not what I need. I need to access the tomcat container app from outside my system itself, through the network. So, how do I map tomcat application to my windows host system ?
While googling around, I could see an option of port-forwarding for boot2docker vm. But, again I am not using boot2docker. I am using docker toolbox.
推荐答案
最后,我能够找到添加端口转发规则的位置。打开oracle VirtualBox Manager。转到设置 - >网络 - >端口转发..
Finally, I was able to find where to add the port-forwarding rule. Open the oracle VirtualBox Manager. Go to Settings-->Network --> Port Forwarding..
这里有一个规则已经可用于ssh。
所以我添加了以下配置的另一个规则:
HostIP:HostPort => 127.0.0.1:9999
GuestIP:GuestPort =>:8888
Here 1 rule is already available for ssh. So I added another rule for this with below configurations: HostIP:HostPort=> 127.0.0.1:9999 GuestIP:GuestPort=> :8888
所以现在如果我调用 http:// localhost:9999 ,它将转发到=> docker-machine :8888并从那里转发到=> tomcatVM:8080。
So now if I invoke http://localhost:9999 , it is forwarded to => docker-machine:8888 and from there it is forwarded to => tomcatVM:8080.
这篇关于在使用docker工具箱时,无法使用主机(Windows)IP访问Docker VM上的tomcat应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!