How to publish ports in docker files

后端 未结 4 2049
有刺的猬
有刺的猬 2021-02-03 21:45

I need to map the ports on the host to the ports on the container. I can achieve this by running the \"docker run\" command with the -p option. How do

4条回答
  •  时光说笑
    2021-02-03 22:28

    What you can do is to EXPOSE a list of ports on your Dockerfile and later run the command docker run -P your_app to publish all the ports exposed on the Dockerfile

提交回复
热议问题