简体   繁体   English

我无法在GCP Compute Engine上访问我的Docker容器

[英]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>:80sudo 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.

相关问题 我无法访问 docker 中的容器 - i can't access container in a docker 我无法使用我的 Azure VM 公共 ip 地址访问我的 docker 容器 - I can't access my docker container with my Azure VM public ip address 尽管设置了防火墙规则,Google Compute Engine 上的 Docker 仍无法访问端口 80 - Docker on Google Compute Engine can't access port 80 despite setting firewall rules 如果我可以通过安装 docker 引擎直接运行我的容器,那么需要 docker 还是 docker EE - what is the need of docker or docker EE if I can run my container directly by installing docker engine 无法访问docker容器 - can't access docker container Docker 容器与 Flask 应用程序:无法访问我的应用程序 - Docker container with Flask App: Can't access my application 无法连接到托管在 GCP Kubernetes Engine 上的 MySQL Docker - Can't connect to MySQL Docker hosted on GCP Kubernetes Engine 为什么我无法访问在 Azure Web 应用程序的 docker 容器中运行的 mongodb? - Why can't I access my mongodb running in a docker container in Azure web apps? windows 的 Docker 桌面:无法通过浏览器访问我的容器 - Docker desktop for windows: Can't access my container via the browser 我是否应该能够访问Docker容器上的端口4200? - Shouldn't I be able to access port 4200 on my docker container?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM