![](/img/trans.png)
[英]pip install google-cloud-pubsub fails install in docker container
[英]pip install fails in Docker container: No route to host
我有一個現有項目,它使用 docker-compose 對所有內容進行了碼頭化。 它似乎在生產中運行,但我無法讓它在我的機器上運行。
在Dockerfile
我有這些行:
COPY requirements.txt /
RUN pip install -r /requirements.txt
我將requirements.txt
安裝到本地 virtualenv 中沒有問題( pip install -r requirements.txt
),但是當我運行docker-compose up
,它以這個錯誤結束:
Step 15/21 : RUN pip install -r /requirements.txt
---> Running in 50357eef88a5
Collecting django-braces==1.13.0 (from -r /requirements.txt (line 2))
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7efe808852e8>: Failed to establish a new connection: [Errno 113] No route to host'))': /simple/django-braces/
[THE LINE ABOVE REPEATS 3 MORE TIMES..]
ERROR: Could not find a version that satisfies the requirement django-braces==1.13.0 (from -r /requirements.txt (line 2)) (from versions: none)
ERROR: No matching distribution found for django-braces==1.13.0 (from -r /requirements.txt (line 2))
ERROR: Service 'api' failed to build: The command '/bin/sh -c pip install -r /requirements.txt' returned a non-zero code: 1
重復行的結尾讓我有點困惑:
No route to host'))': /simple/django-braces/
我知道如果它嘗試“urls” ))
或/simple/django-braces/
會失敗
requirements.txt
對我來說也很好。 這是前幾行:
# Django packages
django-braces==1.13.0
django-cors-headers==2.4.0
django-extensions==2.1.3
django-filter==2.0.0
有人知道這里發生了什么嗎?
好的,找到了。
Dockerfile
中有一個舊的代理定義,必須刪除。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.