[英]Expose my docker container to my external IP on GCP
We have a dockerized app that we imported on a Compute Engine instance with ubuntu 16.04. 我们有一个通过ubuntu 16.04在Compute Engine实例上导入的dockerized应用。 It contains a nginx reverse proxy running on port 80 and in /etc/hosts we've added 127.0.0.1 mydockerizedapp
它包含运行在端口80上的nginx反向代理,在/ etc / hosts中,我们添加了127.0.0.1 mydockerizedapp
The GCE got an external IP address. GCE获得了一个外部IP地址。 How can I set so that when I go on this external IP from a browser, I see the files served by the container nginx ?
我该如何设置,以便当我通过浏览器访问该外部IP时,可以看到容器nginx提供的文件?
You have to expose the ports of your container on the host machine by mapping it. 您必须通过映射在主机上公开容器的端口 。
If you use the cli: --port-mappings=80:80:TCP
如果使用cli:--
--port-mappings=80:80:TCP
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.