title: Docker in Docker: Port Mapping
body: <p>I have found a similar thread, but failed to get it to work. So, the use case is</p>
  
  <p>I start a container on my Linux host</p>
  
  <pre><code>docker run -i -t --privileged -p 8080:2375 mattgruter/doubledocker
  </code></pre>
  
  <p>When in that container, I want to start another one with GAE SDK devserver running.</p>
  
  <p>At that, I need to access a running app from the host system browser.</p>
  
  <p>When I start a container in the container as </p>
  
  <pre><code>docker run -i -t -p 2375:8080 image/name
  </code></pre>
  
  <p>I get an error saying that 2375 port is in use. I start the app, and can curl 0.0.0.0:8080 when inside both containers (when using another port 8080:8080 for example) but cannot preview the app from the host system, since lohalhost:8080 listens to 2375 port in the first container, and that port cannot be used when launching the second container.</p>