[英]Can docker containers within same host have same ports
I am a noob to docker and I was reading the docs: 我是码头工人的菜鸟,我正在阅读文档:
Networks, by definition, provide complete isolation for containers.
根据定义,网络为容器提供完全隔离。
Does that mean I can have nginx service on port 80 in each container in the same host, and start each image to use port 80 within it's own container and map the ports: 这是否意味着我可以在同一主机中的每个容器中的端口80上使用nginx服务,并启动每个映像以在其自己的容器中使用端口80并映射端口:
eg. 例如。
8080:80 <--- container 1
8081:80 <--- container 2
Yes. 是。 Did you try this?
你试过这个吗? It should work just fine.
它应该工作得很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.