title: How to assign a host port to container port using docker if container is already created and running?
body: <p>We can create a new container and define your application port in docker run command like</p>
  
  <pre><code>sudo docker run -d -p 5000:5000 training/webapp python app.py
  </code></pre>
  
  <p>or </p>
  
  <pre><code>sudo docker run -d -P training/webapp python app.py
  </code></pre>
  
  <p>But, what if someone forgot to specify -p or -P option in docker run command? The container get created and runs the application locally. Now how could I assign a port on which application is running locally in container to the port of my Ubuntu host machine?
  Kindly, help on this.
  Thanks.</p>