运行Dockerfile时报错,Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f22bcb635f8>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/flask/文章来源:https://www.toymoban.com/news/detail-603894.html
出现该报错是因为pip install flask时用的国外的服务器,导致连接失败,因此只需要在Dockerfile文件的pip install flask后面跟上国内的镜像地址就行,如阿里云:文章来源地址https://www.toymoban.com/news/detail-603894.html
RUN pip3 install flask -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
到了这里,关于运行Dockerfile报错:ERROR: failed to solve: process “/bin/sh -c pip3 install flask“的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!