docker 多端口映射多卷映射

  1. stop running container
            docker ps -a
      docker stop test01
   2.  commit the container
             docker commit test01 test02
       NOTE: The above,  test02 is a new image that I'm constructing from the  test01 container.test02 是新的image name
           
       3. re- run from the commited image
            docker run -p 8080:8080 -p 80:80-td test02

http://stackoverflow.com/questions/19335444/how-do-i-assign-a-port-mapping-to-an-existing-docker-container


如果一个参数的选项格式是[],比如
-H=[]host
-p=[]portdirection
这都意味着这个flag可以多次出现,所以此处可以多次指定端口映射规则。

例:docker run -d -p 80:80 -p 22:22


猜你喜欢

转载自blog.csdn.net/jackliu16/article/details/80515582