title: connecting to docker with curl
body: <p>I'm following <a href="http://www.ybrikman.com/writing/2015/11/11/running-docker-aws-ground-up/" rel="noreferrer">this</a> tutorial on docker which sets up a small hello world server.</p>
  
  <p>This is the expected behavior:</p>
  
  <pre><code>docker run -d -p 5000:5000 training/webapp:latest python app.py
  curl http://dockerhost:5000
  Hello world!
  </code></pre>
  
  <p>However, I get an error when I run</p>
  
  <pre><code>curl http://dockerhost:5000
  curl: (6) Could not resolve host: dockerhost
  </code></pre>
  
  <p>I looked at some other answers and tried</p>
  
  <pre><code>ping http;//dockerhost:5000
  unknown host http://dockerhost:5000
  
  nslookup http://dockerhost:5000
  ;; connection timed out; no servers could be reached
  
  netstat -utapen | grep 5000
  tcp6       0      0 :::5000                 :::*                    LISTEN      0          251303      -  
  </code></pre>
  
  <p>Some stackoverflow answers (<a href="https://stackoverflow.com/questions/24967855/curl-6-could-not-resolve-host-google-com-name-or-service-not-known">curl: (6) Could not resolve host: google.com; Name or service not known</a>) were talking about DNS issues (wrong DNS server), but I don't know what to do to see if this is relevant to my problem.</p>