title: Docker curriculum tutorial, python pip fails
body: <p>I am following the tutorial in <a href="https://docker-curriculum.com/" rel="nofollow noreferrer">https://docker-curriculum.com/</a> to produce my first Docker image. In section 2.4 we are taught how to configure a simple Dockerfile using the base image <code>python:3-onbuild</code> that will automatically run pip and install dependencies from the <code>requirements.txt</code>.</p>
  
  <p>The problem is the when I try to build docker, the packages simply fail to load:</p>
  
  <pre><code>mgitt@mgpc:~/workspace/docker-curriculum/flask-app$ docker build -t prakhar1989/catnip .
  Sending build context to Docker daemon  8.704kB
  Step 1/3 : FROM python:3-onbuild
  # Executing 3 build triggers...
  Step 1/1 : COPY requirements.txt /usr/src/app/
   ---&gt; Using cache
  Step 1/1 : RUN pip install --no-cache-dir -r requirements.txt
   ---&gt; Running in 74c4e94fa1ba
  Collecting Flask (from -r requirements.txt (line 1))
    Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('&lt;pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc6592831d0&gt;: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/flask/
    Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('&lt;pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc659283cc0&gt;: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/flask/
    Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('&lt;pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc659283208&gt;: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/flask/
    Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('&lt;pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc659283470&gt;: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/flask/
    Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('&lt;pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc659283ba8&gt;: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/flask/
    Could not find a version that satisfies the requirement Flask (from -r requirements.txt (line 1)) (from versions: )
  No matching distribution found for Flask (from -r requirements.txt (line 1))
  The command '/bin/sh -c pip install --no-cache-dir -r requirements.txt' returned a non-zero code: 1
  mgitt@mgpc:~/workspace/docker-curriculum/flask-app$ 
  </code></pre>
  
  <p>I have taken a look at this <a href="https://stackoverflow.com/questions/28668180/cant-install-pip-packages-inside-a-docker-container-with-ubuntu/">stackoverflow solution</a>. These answers seem to have fixed many peoples problem issue of not being able to connect with the Domain Name Server (DNS) but resetting docker or adding the DNS to <code>/etc/dhcp/dhclient.conf</code> did nothing for me.</p>
  
  <p>I have Docker version <code>17.09.0-ce</code> installed and am running on Ubuntu <code>16.04</code>, any ideas?</p>