title: how to troubleshoot docker network issues?
body: <p>I have a new ubuntu system and learning to use docker to serve web stuff, and I can ssh into from my laptop. how can I troubleshoot connecting docker to local network?</p>
  <p>diagram:</p>
  <pre><code>          [router]
               |
      +------------------+
      |                  |
  [laptop:macos]  [server:ubuntu]
  </code></pre>
  <p>if I run on the server:</p>
  <pre><code>&gt; docker run --rm -it -u root  -p 80:80  strm/helloworld-http
  </code></pre>
  <p>then on the server run I can hit the docker server:</p>
  <pre><code>&gt; curl localhost
  &lt;html&gt;&lt;head&gt;&lt;title&gt;HTTP Hello World&lt;/title&gt;...
  </code></pre>
  <p>but from my laptop via local network:</p>
  <pre><code>&gt; curl http://172.*.*.*
  &lt;error cannot connect&gt;
  </code></pre>
  <p>but if I run on the server a simple python script instead of docker:</p>
  <pre class="lang-bash prettyprint-override"><code>&gt; sudo python3 -m http.server 80
  </code></pre>
  <p>I can hit it from my laptop:</p>
  <pre><code>&gt; curl http://172.*.*.*
  &lt;expected web page content success&gt;
  </code></pre>
  <p>docker appears to be unable to connect to the network, or lacks permission to serve externally.</p>
  <ul>
  <li>but it can successfully pull any data needed to build images</li>
  <li>there are no firewalls setup on this machine yet</li>
  <li>python servers can emit data over the same ip and ports, just not docker</li>
  </ul>