Chun-Yen Wang
Chun-Yen Wang

Reputation: 578

django install failed in runnung dockerfile on ubuntu

Greeting,

I followed the docker compose quickstart example at https://docs.docker.com/compose/django/, using my docker environment in CentOS VM and Ubuntu VM. The example works in CentOS, but not in Ubuntu. The failure happens in

RUN pip install -r requirements.txt

The error is as

Step 6/7 : RUN pip install -r requirements.txt
 ---> Running in 7ed9830cea5f
Collecting Django (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 0x7fe12ff70470>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/django/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe12ff70438>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/django/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe12ff706a0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/django/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe12f4fe5f8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/django/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe12f4fea58>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/django/
  Could not find a version that satisfies the requirement Django (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for Django (from -r requirements.txt (line 1))

Could you help me trouble shooting this, and understand why this happens in Ubuntu, but not in CentOS?

Thanks...

Upvotes: 1

Views: 127

Answers (2)

Chun-Yen Wang
Chun-Yen Wang

Reputation: 578

It turned out my /etc/resolv.conf pointed to a wrong nameserver. I still need to investigate why that happens. If manually putting the correct DNS, the docker containers have network.

Upvotes: 1

ajankuv
ajankuv

Reputation: 497

Run pip search and ensure what your looking for is there. Looks like from the errors it can't actually find it.

Docker docs tend to be out of date on the main site.

Upvotes: 0

Related Questions