简体   繁体   English

无法从远程访问Docker端口

[英]Can't access docker port from remote

I start a container on machine whose IP address is 47.foo.bar.bazz : 我在IP地址为47.foo.bar.bazz机器上启动了一个容器:

docker run -it -p 8888:8888 continuumio/miniconda3

And inside the container , 8888 port is opened by a flask application: 在容器内部,通过烧瓶应用程序打开8888端口:

python manage.py runserver -h 0.0.0.0 -p 8888

I can send http request to this port successfully by 我可以通过以下方式成功将http请求发送到此端口:

curl "http://127.0.0.1:8888/api/v1/vocabulary?callback=zoo

But when I use it's IP it doesn't work, and I can't access it from remote machine either 但是当我使用它的IP时它不起作用,而且我也无法从远程计算机访问它

curl "http://47.foo.bar.bazz:8888/api/v1/vocabulary?callback=zoo

Here is some information: 这里是一些信息:

netstat -aptn
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name  
tcp6       0      0 :::80                   :::*                    LISTEN      9211/docker-proxy   
tcp6       0      0 :::8888                 :::*                    LISTEN      28811/docker-proxy  
tcp6       0      0 :::443                  :::*                    LISTEN      9194/docker-proxy  

Btw,I can curl the 80 port successfully using the IP address. 顺便说一句,我可以使用IP地址成功卷曲80端口。

Could anyone please point out what's wrong?How can I access it successfully from remote machine? 任何人都可以指出出什么问题了如何从远程计算机成功访问它?

I figured out here. 我想通了。 Maybe the port is blocked. 也许端口被阻塞了。 On the other hand,I used nginx to forward my request form 80 to 8888. 另一方面,我使用nginx将请求表80转发给8888。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM