Docker Community Forums

Share and learn in the Docker community.

"Get started with Docker Compose" failing at pip install

(Ryanpridgeon) #1

Hi, I’m trying to follow the tutorial here

But when running using “docker-compose up”, the pip install command fails like so;

Step 4/5 : RUN pip install -r requirements.txt --trusted-host
 ---> Running in d0a5b42404dc
Collecting flask (from -r requirements.txt (line 1))
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5c2b1338d0>: Failed to establish a new connection: [Errno -3] Try again',)': /simple/flask/

However, when I run using docker build it successfully compiles and runs;

docker build --no-cache --network=host -t friendlyhello .


Step 4/5 : RUN pip install -r requirements.txt --trusted-host
 ---> Running in 53dfe143e914
Collecting flask (from -r requirements.txt (line 1))
  Downloading (91kB)
Collecting redis (from -r requirements.txt (line 2))
  Downloading (64kB)

Could someone tell me why this doesn’t work with docker-compose like the tutorial states it should?