栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Docker镜像报错:Error response from daemon: Get https://registry-1.docker.io/v2/

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Docker镜像报错:Error response from daemon: Get https://registry-1.docker.io/v2/

Get http://192.168.98.131:89/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

两个原因:

1. 第一个可能是没有配置国内镜像源,默认使用的国外源,下载速度慢或者连接失败, 这里可以使用国内镜像源,也可以添加镜像加速器,推荐使用阿里云,华为云也可

2. 使用私库,没有在配置里关联私库地址

解决方案:

# vi /etc/docker/daemon.json  #修改daemon.json配置文件

使用阿里云镜像加速器:"registry-mirrors": ["https://XXXXXX.mirror.aliyuncs.com"]

添加清华镜像源: "registry-mirrors": ["https://mirrors.tuna.tsinghua.edu.cn/"]

私有镜像库配置镜像源:"insecure-registries": ["192.168.98.131:89"]

前面两个二选一即可,阿里云镜像加速器地址云上能查到,自备

[root@topcheer ~]# systemctl daemon-reload  #加载配置文件
[root@topcheer ~]# systemctl restart docker  #重启

[root@k8s-node02 ~]# docker login 192.168.98.131:89
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

 亲测,有用!

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/962495.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号