2015-06-24 169 views
2

我在Docker容器中運行tomcat。使用docker/containers +無法在瀏覽器中訪問服務器

我的問題是爲什麼我可以在這裏在cygwin 192.168.59.103:8888(使用捲曲或l)),而不是在我的Firefox瀏覽器?

我是windows7的機器上Cygwin和boot2docker

我在我的Windows機器上的IP(做一個ipconfig /所有的cygwin)

10.201.202.25(Preferred) 

我的後備箱2泊塢窗IP(梯級中Cygwin的)

$ boot2docker ip 
192.168.59.103 

泊塢窗中運行此命令來獲取運行

容器
[email protected]:~$ docker run -it --rm -p 8888:8080 tomcat:8.0 

這是服務器運行起來

[email protected]:~$ docker ps 
CONTAINER ID  IMAGE    COMMAND    CREATED    STATUS    PORTS     NAMES 
c1b19bf099f0  tomcat:8   "catalina.sh run" 3 hours ago   Up 3 hours   0.0.0.0:8888->8080/tcp high_feynman 

我運行容器的IP地址爲172.17.0.2

[email protected]:~$ docker inspect high_feynman | grep IP 
     "GlobalIPv6Address": "", 
     "GlobalIPv6PrefixLen": 0, 
     "IPAddress": "172.17.0.2", 
     "IPPrefixLen": 16, 
     "IPv6Gateway": "", 
     "LinkLocalIPv6Address": "fe80::42:acff:fe11:2", 
     "LinkLocalIPv6PrefixLen": 64, 
[email protected]:~$ 

工作

[email protected]:~$ curl localhost:8080 | head 

不起作用

[email protected]:~$ curl localhost:8888 | head 

工作

[email protected]:~$ curl 172.17.0.2:8080 | head 

不起作用

[email protected]:~$ curl 172.17.0.2:8888 | head 

cygwin的版本:不工作

$ curl 192.168.59.103:8080 | head 

cygwin的版本:工作

$ curl 192.168.59.103:8888 | head 

備註此問題已被問here,但我已經按照要求在我的虛擬機上設置了prtforwarding,但它仍然不起作用。還有什麼我可以做的嗎?

回答

0

不得不取消選中Automatically detect settings鉻工作

不得不打勾use system proxy settings在Firefox

我不知道究竟是什麼,這意味着如果有人要評論? 而我不認爲我必須去做另一個問題中提到的端口轉發

相關問題