已存在的容器,原来端口-p 80:66 要怎么操作才能把端口改成 -p 80:77,就是把映射从66改到77?必须要重新建一个容器吗?
世界只因有你2017-04-25 09:05:39
You shouldn’t be able to change the port now. You can look at the docker update option
某草草2017-04-25 09:05:39
After checking the information, it seems that it is currently not possible to directly modify the port expose on the original container, and the docker update command does not support it. This demand is very loud.
Submitting the current container into an image and then running it from the new image is also a compromise.
--- update
Modify Dockerfile
里的 expose
and then build it again.
If you don’t want to rebuild the container, you can expose it in docker run
使用 --expose
参数指定,相当于覆盖 Dockerfile
.