2017-10-04 148 views
1

問候,Django的安裝失敗runnung dockerfile在Ubuntu

我跟着搬運工撰寫快速入門例如在https://docs.docker.com/compose/django/,使用CentOS的VM和Ubuntu VM我的搬運工環境。該示例在CentOS中運行,但不在Ubuntu中運行。故障發生在

RUN pip install -r requirements.txt 

錯誤是

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)) 

你能幫我故障排除這一點,明白爲什麼這種情況發生在Ubuntu的,但不是在CentOS的?

謝謝...

回答

0

運行點匹配搜索,並確保你在找什麼。看起來像是它實際上找不到的錯誤。

Docker文檔傾向於在主站點上過期。

1

原來,我的/etc/resolv.conf指向了一個錯誤的名稱服務器。我仍然需要調查爲什麼發生。如果手動將正確的DNS,碼頭集裝箱有網絡。