无法将python包下载到Docker镜像上

时间:2017-08-31 23:07:41

标签: python docker pip

我是DOCKER用户的初学者,并且正在尝试按照docker指令进行第一次尝试。 。

以下是指示链接:https://docs.docker.com/get-started/part2,我已关注, 但是,当我要执行这一步时," docker build -t friendlyhello。",我总是看到这种类型的失败:

Collecting Flask (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 0x2b1ce8301950>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/flask/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x2b1ce8301b50>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/flask/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x2b1ce83011d0>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/flask/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x2b1ce8301710>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/flask/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x2b1ce8301150>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/flask/
  Could not find a version that satisfies the requirement Flask (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for Flask (from -r requirements.txt (line 1))
The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1

我用Google搜索并在此处找到了类似的报告:Can't download python packages onto Docker image

但是他们在docker中使用了糟糕的DNS值,而在我的环境中,我能够运行相同的cmd:&#34; docker运行busybox nslookup google.com&#34;,w /或w / o给予显式DNS值。

那么可能是我失败的原因是什么?

谢谢,

-cji

0 个答案:

没有答案