国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

nat - 如何用docker制作一個(gè)端口轉(zhuǎn)發(fā)的鏡像?
滿天的星座
滿天的星座 2017-04-25 09:01:35
0
2
926

比如我想把本地的8080端口轉(zhuǎn)發(fā)到本地的9090端口,這個(gè)如何封裝呢?端口都是宿主機(jī)之間轉(zhuǎn)發(fā),不需要轉(zhuǎn)發(fā)到容器里面去,常用的一個(gè)場(chǎng)景就是將內(nèi)網(wǎng)的數(shù)據(jù)庫端口轉(zhuǎn)發(fā)到公網(wǎng)上。

滿天的星座
滿天的星座

reply all(2)
習(xí)慣沉默

Your description is really hard to understand. The local port is forwarded to the local port. What is this "local" designation, the container or the host?

For mapping the container port to the host, can't the -p parameter be easily implemented?
docker run ... -p 13306:3306 mysql
Doesn’t this map the 3306 port of the container MySQL service to the 13306 port of the host? External access to port 13306 can connect to the database.

洪濤

As mentioned above, docker supports port mapping from container to host, using the official -p-Pparameters

-P         : Publish all exposed ports to the host interfaces
-p=[]      : Publish a container?s port or a range of ports to the host

For details, please refer to the official website instructions: https://docs.docker.com/engin...

As for the local-to-local port mapping you described, it should not be a function of Docker.

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