-p后面直接带网络程序,不大灵活啊。
ps -p可以同时开放很多个网络端口么?
曾经蜡笔没有小新2017-04-26 09:03:05
It’s okay, but don’t do it. If you have multiple programs, you should open multiple containers. This is the correct posture of docker
Recommended to use docker-compose
漂亮男人2017-04-26 09:03:05
Yes.
For example, if you use docker to run a nodejs program, the program listens to two ports, such as8080
和3443
, 你就需要-p 8080:8080 -p 3443:3443