我有一个现有项目,该项目已使用docker-compose进行了docker化。它似乎已在生产中运行,但是我无法在我的计算机上运行它。
在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
有人知道这是怎么回事吗?
答案 0 :(得分:0)
好,找到了。
Dockerfile
中有一个旧的代理定义,必须删除。
不好意思,请您抽出宝贵的时间。不管我希望你有一个美好的一天..:-)