I am following the tutorial in https://docker-curriculum.com/ to produce my first Docker image. In section 2.4 we are taught how to configure a simple Dockerfile using the base image python:3-onbuild
that will automatically run pip and install dependencies from the requirements.txt
.
The problem is the when I try to build docker, the packages simply fail to load:
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/
---> Using cache
Step 1/1 : RUN pip install --no-cache-dir -r requirements.txt
---> 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('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc6592831d0>: 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('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc659283cc0>: 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('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc659283208>: 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('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc659283470>: 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('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc659283ba8>: 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$
I have taken a look at this stackoverflow solution. 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 /etc/dhcp/dhclient.conf
did nothing for me.
I have Docker version 17.09.0-ce
installed and am running on Ubuntu 16.04
, any ideas?