For the existing container, how do I operate the original port -p 80:66 to change the port to -p 80:77, that is, to change the mapping from 66 to 77? Do you have to rebuild a container?
After checking the data, it seems that it is impossible to directly modify port expose on the original container at present, and docker update command is not supported. The demand is very high.
It is also a compromise to submit the current container to a mirror image and then run it from the new mirror image.
— update
Modify
Dockerfile
From insideexpose
, and then build it.If you do not want to rebuild the container, you can
docker run
Use--expose
Parameter designation, equivalent to overrideDockerfile
This is the first time I’ve ever seen a movie.