How can I expose more than 1 port with Docker?

前端 未结 4 1399
逝去的感伤
逝去的感伤 2020-11-28 17:04

So I have 3 ports that should be exposed to the machine\'s interface. Is it possible to do this with a Docker container?

4条回答
  •  独厮守ぢ
    2020-11-28 17:58

    To expose just one port, this is what you need to do:

    docker run -p :
    

    To expose multiple ports, simply provide multiple -p arguments:

    docker run -p : -p :
    

提交回复
热议问题