Looking in indexes: xxx WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None

2023-05-16

docker 构建python程序报错

Step 7/10 : RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn --default-timeout=20 --no-cache-dir -r requirements.txt
 ---> Running in 2fe1512d82e8
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
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 0x7fa7b89c4160>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/certifi/
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 0x7fa7b8618c10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/certifi/
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 0x7fa7b867da90>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/certifi/
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 0x7fa7b867da00>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/certifi/
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 0x7fa7b867d970>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/certifi/
ERROR: Could not find a version that satisfies the requirement certifi==2022.6.15 (from versions: none)
ERROR: No matching distribution found for certifi==2022.6.15

本次测试、另一台服务器测试没问题。公司通过虚拟镜像搞的服务器出现问题,怀疑是配置

查看linux本身环境dns配置

cat /etc/resolv.conf
# 
nameserver 218.1.23.333

进入/etc/docker/下

cd /etc/docker

修改daemon.json文件(增加dns配置)如下

{
"insecure-registries": ["218.1.23.333:8089"],
"registry-mirrors": ["https://4xtasccp.mirror.aliyuncs.com"],
"dns":["218.1.23.333"]
}

重新加载配置文件

systemctl daemon-reload

重启docker生效

systemctl restart docker

重新构建python镜像

完成

补充docker daemon.json配置相关说明

{
    "api-cors-header": "",
    "authorization-plugins": [],
    "bip": "",
    "bridge": "",
    "cgroup-parent": "",
    "cluster-store": "",
    "cluster-store-opts": {},
    "cluster-advertise": "",
    "debug": true,            # 启用debug的模式,启用后,可以看到很多的启动信息,默认false
    "default-gateway": "",
    "default-gateway-v6": "",
    "default-runtime": "runc",
    "default-ulimits": {},
    "disable-legacy-registry": false,
    "dns": [
        "192.168.1.1"
    ],  # 设定容器DNS的地址,在容器的 /etc/resolv.conf文件中可查看
    "dns-opts": [],        # 容器 /etc/resolv.conf 文件,其他设置
    "dns-search": [],      # 设定容器的搜索域,当设定搜索域为 .example.com 时,在搜索一个名为 host 的 主机时,DNS不仅搜索host,还会搜索host.example.com 。 注意:如果不设置, Docker 会默认用主机上的 /etc/resolv.conf 来配置容器
    "exec-opts": [],
    "exec-root": "",
    "fixed-cidr": "",
    "fixed-cidr-v6": "",
    "graph": "/var/lib/docker",      # 已废弃,使用data-root代替,这个主要看docker的版本
    "data-root": "/var/lib/docker",  # Docker运行时使用的根路径,默认/var/lib/docker
    "group": "",                    # Unix套接字的属组,仅指/var/run/docker.sock
    "hosts": [],                    # 设置容器hosts
    "icc": false,
    "insecure-registries": [],      # 配置docker的私库地址
    "ip": "0.0.0.0",
    "iptables": false,
    "ipv6": false,
    "ip-forward": false,  # 默认true, 启用 net.ipv4.ip_forward ,进入容器后使用 sysctl -a | grepnet.ipv4.ip_forward 查看
    "ip-masq": false,
    "labels": [
        "nodeName=node-121"
    ],  # docker主机的标签,很实用的功能,例如定义:–label nodeName=host-121
    "live-restore": true,
    "log-driver": "",
    "log-level": "",
    "log-opts": {},
    "max-concurrent-downloads": 3,
    "max-concurrent-uploads": 5,
    "mtu": 0,
    "oom-score-adjust": -500,
    "pidfile": "",    # Docker守护进程的PID文件
    "raw-logs": false,
    "registry-mirrors": [
        "xxxx"
    ],  # 镜像加速的地址,增加后在 docker info中可查看
    "runtimes": {
        "runc": {
            "path": "runc"
        },
        "custom": {
            "path": "/usr/local/bin/my-runc-replacement",
            "runtimeArgs": [
                "--debug"
            ]
        }
    },
    "selinux-enabled": false,  # 默认 false,启用selinux支持
    "storage-driver": "",
    "storage-opts": [],
    "swarm-default-advertise-addr": "",
    "tls": true,      # 默认false, 启动TLS认证开关
    "tlscacert": "",  # 默认~/.docker/ca.pem,通过CA认证过的的certificate文件路径
    "tlscert": "",    # 默认~/.docker/cert.pem,TLS的certificate文件路径
    "tlskey": "",      # 默认~/.docker/key.pem,TLS的key文件路径
    "tlsverify": true, # 默认false,使用TLS并做后台进程与客户端通讯的验证
    "userland-proxy": false,
    "userns-remap": ""
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Looking in indexes: xxx WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None 的相关文章

随机推荐

  • 无法显示此网页

    上网过程中电脑打开浏览器 xff0c 浏览器突然显示 34 无法显示此网页 34 有可能是网络出现问题了 xff0c 也有可能是浏览器设置原因 xff0c 也有可能网站服务器原因 先用排除法来判断是哪种原因造成的 xff0c 再一一解决 0
  • 电脑添加打印机方法/步骤

    方法1 主要有以下几种方法 xff1a 1 新购买的打印机都会有自带的驱动软件安装光盘 xff0c 如果你电脑上有光驱的话 xff0c 直接安装上就可以了 xff1b 如果没有光驱那就到所购买的打印机品牌官网上去找对应型号的驱动下载安装上
  • ssh常见命令

    Linux系统的远程管理工具大概有几种 xff1a telnet xff0c ssh xff0c vnc等 xff0c 其中ssh是最常用的管理方法 xff0c 采用密文的传输方式 xff0c 简单安全 基本用法 最简单的用法就是不带参数
  • 芯片春秋: 开源架构RISC-V前世今生

    不久前 xff0c 特斯拉加入 RISC V基金会 xff0c 并考虑在新款芯片中使用免费的 RISC V 设计 至此 xff0c 已有IBM NXP 西部数据 英伟达 高通 三星 谷歌 华为等100多家科技公司加入RISC V阵营 出现这
  • 华为设备配置——配置通过FTP进行文件操作

    1 实验原理 FTP xff08 File Transfer Protocol xff0c 文件传输协议 xff09 是 TCP IP 协议组中的协议之一 其主要功能是向用户提供本地和远程主机之间的文件传输 xff0c FTP采用C S x
  • Linux学习笔记

    Linux linux的本质是一切皆目录 学习来自哔哩哔哩狂神说 xff0c 视频地址https www bilibili com video BV187411y7hF hostnamectl xff1a 查看linux信息 关机 shut
  • Linux .deb包的安装(gdebi)

    一些废话 deb包可以通过传统的dpkg命令来实现 xff0c 但过程中经常会遇到一些问题 所以有个软件叫GDebi xff0c 可以更加有效的帮助安装deb 通过点击deb包即可实现安装 xff0c 当然 xff0c 也可以通过命令行模式
  • 简单的理解EKF算法1

    简单的理解EKF算法 经典的EKF公式简化版的EKF公式参考资料 经典的EKF公式 来我们先来看一下第一眼看上去不知道在讲啥的公式 1 x k 61 A
  • Myeclipse/Eclipse 如何停止死循环进程

    今天在在练习hibernate 对象导航查询的时候想输出一对多 xff08 客户1 联系人n xff09 关系里面想输出某个客户的所有联系人 xff0c 便用Iterator对set进行遍历 xff0c 顺便看看iterator里面的方法具
  • 如何快速解决zookeeper闪退问题!

    有以下2种情况 xff1a 第一种方法 xff1a 按任意键直接闪退 xff0c 这时我们只需要修改一下配置文件即可 xff0c 右键 zkServer cmd xff0c 编辑文件内容 xff0c 在末尾输入 pause 保存并退出 在双
  • Centos6.8更新yum

    一 重新安装 1 卸载yum CentOS6停止维护更新日期2020年11月30日 下架了包括官方所有的CentOS6源 xff08 包括国内的镜像站 xff09 span class token comment 查看yum span rp
  • Debian 10系统最小化安装

    Debian 10最小化安装 一 Debian系统介绍 广义的Debian是指一个致力于创建自由操作系统的合作组织及其作品 xff0c 由于Debian项目众多内核分支中以Linux宏内核为主 xff0c 而且 Debian开发者 所创建的
  • 在Ubuntu16.04系统下安装Python3.6 + pip3 的完整步骤

    python gt 垃圾垃圾真垃圾 xff08 开玩笑的 xff09 Ubuntu16 04版本最新的Python 3 x为版本3 5 1 要安装Python 3 6 xff0c 请运行以下命令 xff1a wget https www p
  • Ubuntu中的中文字体设置

    首先我们要搞清楚我们要设置的是系统的字体还是Firefox中的字体 一 设置的是Firefox浏览器中的字体 我们只需要在点击浏览器右上角Open menu gt Preferences gt Content gt Fonts amp Co
  • 详解叠瓦式磁记录SMR盘基础知识

    SMR Shingled Magnetic Recording 叠瓦式磁记录盘 是一种采用新型磁存储技术的高容量磁盘 SMR盘将盘片上的数据磁道部分重叠 xff0c 就像屋顶上的瓦片一样 xff0c 这种技术被称为叠瓦式磁记录技术 该技术在
  • 如何将c++中utf-16编码的字符串(wstring)转为utf-8(string)?

    最近使用到了mysql connector cpp xff0c 通过这个库获取到的字符串类型是mysql string xff0c 其实其实质就是mysql自己实现的wstring 如果直接进行转换 xff1a mysqlx span cl
  • FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:app:stripDe

    文章目录 问题描述解决方法 问题描述 android studio 编译2012 年的项目时出现了如下问题 xff1a FAILURE Build failed with an exception What went wrong Execu
  • 学习C++:使用C++11实现阻塞队列

    目录 1 代码 1 代码 span class token macro property span class token directive keyword ifndef span BLK QUEUE H span span class
  • Scoop安装遇到 “raw.githubusercontent.com未能解析” 解决方案

    想试试windows包管理器Scoop xff0c 但安装总是报错 xff1a iwr 未能解析此远程名称 39 raw githubusercontent com 39 所在位置 行 1 字符 1 43 iwr useb get scoo
  • Looking in indexes: xxx WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None

    docker 构建python程序报错 Step span class token number 7 span 10 span class token builtin class name span RUN pip3 span class