How to remove proposely port in Docker?

Hello,

There is such a container:
root@ip-172-31-34-200:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b3682f324136 ubuntu "/bin/bash" 5 minutes ago Up 5 days 0.0.0.0:8080->80/tcp TestO

Is it possible to reassign the port to be, for example, like this: 0.0.0.0:8050->80/tcp? Or to cancel the forwarding.
March 19th 20 at 08:53
1 answer
March 19th 20 at 08:55
Can. In the command line key "-R" is responsible for mapping port
So?

docker stop b3682f324136 
docker run-p 8050:80 TestO


Need without losing everything that is there. - justus.Abbott90 commented on March 19th 20 at 08:58
@justus.Abbott90if when creating a container, you do volume to store its data, it will be difficult to do. Here is the discussion https://github.com/docker/docker.github.io/issues/4942
So most likely the container will need to kill and run it again with the necessary parameters, at the same time can attend to the preservation of data (volume) in the future. - Luisa_Litt commented on March 19th 20 at 09:01
@Luisa_Littif I didn't do "volume" I can't create an image from the container and run it again? - justus.Abbott90 commented on March 19th 20 at 09:04

Find more questions by tags Docker