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


    项目场景:

    使用docker-compose创建django容器


    问题描述

     > [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.
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    解决dockerfile创建镜像时pip install报错的bug
    在这里插入图片描述


    解决方案:

    执行service docker restart

  • 相关阅读:
    编写ESM风格的nodejs应用
    前端HTML点击图片放大效果展示
    11.Linux系统:定时任务备份mysql数据库为文件并传输到其他服务器
    C++基础语法和概念
    R语言APRIORI关联规则、K-MEANS均值聚类分析中药专利复方治疗用药规律网络可视化...
    HLS最全知识库
    2020最新Java面试题
    javaweb springboot餐厅点餐系统源码
    [C#] 允许当前应用程序通过防火墙
    台湾SSS鑫创SSS1700替代Cmedia CM6533 24bit 96KHZ USB音频编解码芯片
  • 原文地址:https://blog.csdn.net/m0_58598240/article/details/133576136