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