[英]I can't access my Docker container on GCP Compute Engine
I have my Docker container running on GCP Compute Engine. 我在GCP Compute Engine上运行了Docker容器。 The CE server is running on CentOS 7. My Docker container has the application being served by Nginx with port 80 exposed.
CE服务器在CentOS 7上运行。我的Docker容器的应用程序由Nginx提供,端口80暴露。 For some reason, I can't access it from the external IP address on my browser.
出于某种原因,我无法从浏览器的外部IP地址访问它。 I ran the container with this command:
我用这个命令运行容器:
sudo docker run --name myapp -p 80:80 -d myapp:1.0.0
When I do sudo curl <internal_ip>:80
or sudo curl <localhost>:80
it will show that the application is running and returns back the content, but if I try to access in my browser with <external_ip>:80
, it doesn't load anything. 当我执行
sudo curl <internal_ip>:80
或sudo curl <localhost>:80
,它将显示应用程序正在运行并返回内容,但如果我尝试使用<external_ip>:80
在我的浏览器中访问它,它不会什么都不加载。 What can I do to make this accessible through the external IP address? 如何通过外部IP地址访问它?
我似乎必须配置防火墙以打开端口80。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.