docker Get "https://registry-1.docker.io/v2/": x509: certificate is valid for

前言

docker 在进行 build 时,报错:Get "https://registry-1.docker.io/v2/": x509: certificate is valid for

问题原因:Docker 客户端无法验证 Docker Hub 服务器的 SSL/TLS 证书

解决

在 /etc/docker/daemon.json 中新增国内镜像源:

复制代码
   "registry-mirrors": [
            "https://6kx4zyno.mirror.aliyuncs.com",
            "https://1nj0zren.mirror.aliyuncs.com",
            "https://docker.mirrors.ustc.edu.cn",
            "http://f1361db2.m.daocloud.io",
            "https://registry.docker-cn.com",
            "http://hub-mirror.c.163.com",
            "https://mirror.ccs.tencentyun.com/",
            "https://dockerproxy.com",
            "https://docker.nju.edu.cn",
            "https://mirror.iscas.ac.cn",
            "https://docker.mirrors.sjtug.sjtu.edu.cn",
            "https://dockerhub.azk8s.cn",
            "https://docker.m.daocloud.io"
        ],
复制代码
systemctl daemon-reload

systemctl restart docker

重启 docker,问题解决!

 
 
分类: Linux
 

posted on   阿陶学长  阅读(137)  评论(0编辑  收藏  举报

(评论功能已被禁用)
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示