docker - 一个container下面可否映射多个端口到Host
迷茫
迷茫 2017-04-21 10:55:47
0
2
823

Docker下在一个container下面可否映射多个端口到Host

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
黄舟

Of course it is possible, buddy, you can read the document carefully. There are instructions in the document. If the option format of a parameter is [], such as
-H=[]host
-p=[]portdirection
This means that this flag can appear multiple times, so the port mapping rule can be specified multiple times here.

In addition, this can be implemented using EXPOSE in the Dockerfile. Of course, it can also be specified multiple times.

Peter_Zhu

Yes, for example: docker run -d -p 80:80 -p 22:22
Map 80 and 22 to host respectively

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template