Saturday, 4 November 2017

Docker - Rename Container

To add port forwardings, I always follow these steps,
  1. stop running container
    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.
  3. re-run from the commited image
    docker run -p 8080:8080 -td test02
    
Where the first 8080 is the local port and the second 8080 is the container port.



---
Thanks

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


No comments:

Post a Comment