Imaging this scenario, I've started an tomcat container days ago by executing this command:
docker run -dit -p 8080:8080 --name foo tomcat:7.0
It worked fine and I've made some changes inside this foo
container like installing necessary dependencies and editor.
But today I found besides port 8080, I need to expose another port 8005
of this container. So my question is how dynamically change this container's startup parameters so that all my changes made to this foo
container will be kept?
Currently I only came up with one idea:
docker commit foo bar:latest
docker run -dit -p 8080:8080 -p 8005:8005 --name bar bar:latest
Is there an better solution?