1、创建容器是指定

docker run -p <host_port1>:<container_port1> -p <host_port2>:<container_port2>

2、修改dockerfile expose所需要的端口,这样可以免去-p参数。