docker暴露多个端口
以下是stackoverflow鬼老的回答:To expose just one port, this is what you need to do:
docker run -p <host_port>:<container_port> To expose multiple ports, simply provide multiple -p arguments:
docker run -p <host_port1>:<container_port1> -p <host_port2>:<container_port2> 或者你可以直接桥接网络,然后在dockerfile上面直接expose你所需要的端口,这样可以免去-p参数。
页:
[1]