Linux-Docker阿里云镜像仓库失效

写在前面,这个是我很早之前在VmWare安装的Linux7,通过yum 安装的docker,但是今天怎么都无法pull镜像,报错如下。

bash 复制代码
Error response from daemon: Get "https://registry-1.docker.io/v2/":
net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers

问题排查

检查网络是否通常
bash 复制代码
ping www.baidu.com
设置阿里云镜像加速地址
bash 复制代码
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://95lnapms.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
pull 镜像仍然报错,查看docker是否成功设置镜像地址
bash 复制代码
docker info | grep Registry -A3 
查看docker 日志看报错问题
bash 复制代码
# 通过yum 安装的docker日志在 /var/log/messages
tail -500f /var/log/messages
# 直接查看报错信息
Oct  9 21:53:38 localhost dockerd: time="2024-10-09T21:53:38.438867024-04:00" level=info msg="Attempting next endpoint for pull after error: denied: This request is forbidden. Please proceed to https://help.aliyun.com/zh/acr/product-overview/product-change-acr-mirror-accelerator-function-adjustment-announcement to view the announcement." spanID=51a7bcba48f43406 traceID=92a5ccfd35082cb24dd48789f28e858a
Oct  9 21:53:53 localhost dockerd: time="2024-10-09T21:53:53.439850479-04:00" level=warning msg="Error getting v2 registry: Get \"https://registry-1.docker.io/v2/\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)" spanID=51a7bcba48f43406 traceID=92a5ccfd35082cb24dd48789f28e858a
# 大概意思就是尝试从阿里云镜像仓库拉取了,但是报错了,然后在从docker原来的镜像仓库拉去,可能网络不通也拉取不到
替换新的镜像仓库地址
bash 复制代码
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
    "registry-mirrors": [
        "https://do.nark.eu.org",
        "https://dc.j8.work",
        "https://docker.m.daocloud.io",
        "https://dockerproxy.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.nju.edu.cn"
    ]
}
EOF
sudo systemctl daemon-reload
相关推荐
用户2367829801681 小时前
Linux systemctl 服务管理命令:从 systemd 架构到实战技巧
linux
LIZHUOLONG11 小时前
linux 设备初始化
linux·运维·服务器
雪霁清寒2 小时前
麒麟V10用MobaXterm远程连接SSH偶尔卡顿的问题
linux·ssh
ylscode2 小时前
Linux CIFSwitch 内核新漏洞允许攻击者获得 root 权限
linux·运维·服务器
Plastic garden2 小时前
Docker compose ruoyi示例
运维·docker·容器
qq_452396232 小时前
第十四篇:《Docker Swarm 生产实践:堆栈部署与配置管理》
运维·docker·容器
qq_452396233 小时前
第十三篇:《Docker Swarm 集群基础》
运维·docker·容器
诸葛务农3 小时前
共沸脱水技术及其在光刻胶用PGMEA纯化中的应用(中)
linux·数据库·人工智能
lld9510273 小时前
(二)从验证到执行:策略实时运行全链路
linux·服务器·数据库
坤昱3 小时前
cfs调度类深入解刨——最新内核细节分析5
linux·分布式·cfs调度·eevdf调度·linux调度·linux技术·kernel最新版本内容