解决dockerfile创建镜像时pip install报错的bug

项目场景:

使用docker-compose创建django容器


问题描述

python 复制代码
 > [5/5] RUN /bin/bash -c 'source ~/.bashrc && python3 -m pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple':              
0.954 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple                                                                                   
15.98 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fefee58f1d0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/aliyun-python-sdk-core/                                                                                                                        
31.50 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fefea3e8d10>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/aliyun-python-sdk-core/
47.53 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fefea3e9710>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/aliyun-python-sdk-core/
64.55 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fefea3e9f50>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/aliyun-python-sdk-core/
83.57 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fefea3ea8d0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/aliyun-python-sdk-core/
98.59 ERROR: Could not find a version that satisfies the requirement aliyun-python-sdk-core (from versions: none)
98.59 ERROR: No matching distribution found for aliyun-python-sdk-core
113.6 WARNING: There was an error checking the latest version of pip.

解决dockerfile创建镜像时pip install报错的bug


解决方案:

执行service docker restart

相关推荐
从int开始1 天前
加速排查线上bug
bug
LilySesy1 天前
【业务案例】F.13——SAP系统标准的清帐程序有BUG?
运维·bug·sap·abap·esb·internet服务
guhy fighting1 天前
原生toFixed的bug
前端·javascript·bug
你疯了抱抱我1 天前
【CPH系列】RFID标签读取模块,开发说明文档(包含重要内容和BUG)
bug·rfid·工控·电子标签
FakeOccupational1 天前
fpga系列 HDL:verilog 常见错误与注意事项 quartus13 bug 初始失效 reg *** = 1;
fpga开发·bug
我有一棵树1 天前
style标签没有写lang=“scss“引发的 bug 和反思
前端·bug·scss
℡52Hz★1 天前
如何正确定位前后端bug?
前端·vue.js·vue·bug
ShiinaKaze3 天前
【MCU】CH591用软件 I2C 出现的 bug
mcu·bug·i2c
阑梦清川5 天前
用户中心项目教程(二)---umi3的使用出现的错误
bug
JZC_xiaozhong5 天前
支付宝“政府补贴”bug事件背后的权限管理启示
大数据·数据库·安全·ci/cd·金融·云计算·bug