使用 docker 构建 django cms 应用时,出现了以下的错误信息

$ git clone git@github.com:django-cms/django-cms-quickstart.git

$ cd django-cms-quickstart

$ docker compose build web

.....

=> ERROR [4/5] RUN pip install -r requirements.txt                                                             93.5s
------
 > [4/5] RUN pip install -r requirements.txt:
#0 8.385 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))  after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/asgiref/
#0 13.94 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/asgiref/
#0 20.00 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/asgiref/
#0 30.52 Collecting asgiref==3.5.2
#0 36.61   Downloading asgiref-3.5.2-py3-none-any.whl (22 kB)
#0 88.27 ERROR: Could not find a version that satisfies the requirement boto3==1.14.49 (from versions: none)
#0 88.27 ERROR: No matching distribution found for boto3==1.14.49
------
failed to solve: executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code: 1

关键错误信息,是 pip install 时报错: connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:1129)’))’

这样的错误信息,如果是在操作系统使用 pip install 时发生,我们通过配置修改 pip即可解决

> pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

对于上面 docker 编译出现问题我们通过直接修改 Dockerfile  中的 pip install 指令来进行换源

RUN pip install -r requirements.txt  -i https://mirrors.aliyun.com/pypi/simple/

 

原文地址:https://blog.csdn.net/ForestK/article/details/128525371

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_43994.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注