未能将Python包下载到Docker镜像上

我是DOCKER用户的初学者,并试图按照docker的说明来第一次尝试。 。

这里是指令链接: https : //docs.docker.com/get-started/part2 ,我跟着,但是当我运行这个步骤时,“docker build -t friendlyhello”,我总是看到这种types的失败:

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 

我已经search了一下,发现类似的报告在这里: 不能下载到Docker图像的Python包

但是他们在Docker中贡献了使用不好的DNS值,而在我的env中,我能够运行相同的cmd:“docker run busybox nslookup google.com”,w / o提供明确的DNS值。

那么,我失败的原因是什么?

谢谢,

-cji