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
相关推荐
Peace几秒前
【运维Linux基础之高频Linux命令】
linux·运维
Nontee26 分钟前
Docker基础
docker·容器·eureka
城南观北1 小时前
Ubuntu 解决 apt 锁占用 + 安装 net-tools + 搭建 SSH 远程连接(保姆级实操)
linux·ubuntu·ssh
s_w.h1 小时前
【 linux 】文件管理与重定向
linux·运维·服务器
烟雨江南aabb1 小时前
Docker第一弹 Docker是什么?
运维·docker·容器
Cloud_Shy6181 小时前
Linux 系统定时任务 Cron(d) 服务应用实践(二:生产环境下的用户定时任务)
linux·运维·服务器·centos·云计算
ai产品老杨1 小时前
解耦异构算力与多协议接入:基于 Docker 与 GB28181 的企业级 AI 视频管理平台架构演进与源码交付实践
人工智能·docker·音视频
STDD1 小时前
strace 和 perf:Linux 进程调试和性能分析深度指南
linux·运维·php
Rain5092 小时前
05. mini-cc 工具系统:让 AI 拥有动手能力
linux·前端·人工智能·ubuntu·typescript·ai编程
2301_803538952 小时前
Pod启动失败?K8s中Pod创建常见问题与排查指南
docker·容器·kubernetes