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.
You shouldn’t be able to change the port now. You can look at the docker update option
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
.