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
相关推荐
YYRAN_ZZU18 分钟前
FlameGraph 火焰图介绍和使用
linux·嵌入式硬件
正在走向自律20 分钟前
Linux 服务器部署 DeepSeek 大模型完全指南(2026 版)
linux·运维·服务器·deepseek·部署deepseek·安装ollama·配置api服务
夜雪一千1 小时前
Linux 管道、重定向命令介绍
linux·运维·chrome
江华森1 小时前
数据中心网络技术基础 —— 从原理到实操
linux·运维
牛马工作号2 小时前
Copyparty 轻量文件共享:Docker Compose 部署、权限与多协议使用全指南
运维·docker·容器
骑着蜗牛撵大象3272 小时前
手写一个 HTTP 服务器:从 socket 到 epoll,Linux 上到底怎么把请求变成响应
linux·服务器·网络·http·epoll·socket编程·并发模型
程序员初一2 小时前
我在 1C1G 的服务器上装了个桌面环境,然后用 VNC 连它,然后我后悔了
linux·ssh
星恒随风2 小时前
Linux Socket TCP编程(二):逐文件重构多进程、多线程与线程池服务器,深入fork、pthread_create、popen和std::bind
linux·服务器·笔记·学习·tcp/ip
晚风叙码2 小时前
Linux 进程概念(下):程序地址空间与虚拟内存
linux·服务器·算法
无足鸟ICT3 小时前
【RHCA+】影响Linux系统性能的因素
linux·运维·服务器