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
相关推荐
OpenPomeloxCommunity13 分钟前
Linux 同步机制之 spinlock 设计与实现(二):ARM32实现
linux
爱莉希雅&&&32 分钟前
Rocky Linux 10.1 + K8s 1.36.3 离线集群部署笔记(Kubernetes)
linux·笔记·docker·kubernetes·calico
三84437 分钟前
基于 NFS 共享存储的 Nginx Web 服务部署项目
linux·运维·服务器
逻极40 分钟前
Shell脚本实战:从“能跑”到“高效”的3个关键跃升
linux·服务器·shell·脚本
ARM|X86+FPGA工业主板厂家42 分钟前
Linux+Xenomai 实时系统在机器人中的应用
linux·运维·机器人
唔661 小时前
Linux工具使用情况buildroot
linux·运维·服务器
云泽8081 小时前
Linux 核心机制详解(三):文件系统权限与共享安全——从删除规则到粘滞位防护
linux·运维·安全
码农阿豪1 小时前
Prometheus怎么监控另一台Linux服务器?Node Exporter配置教程
linux·服务器·prometheus
BullSmall1 小时前
Jenkins LTS JDK21 docker-compose.yml(生产可用)
运维·docker·jenkins
念何架构之路1 小时前
docker-Builder镜像构建
运维·docker·容器