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
相关推荐
ljh5746491196 分钟前
linux awk 命令
linux·运维·chrome
Uncertainty!!7 分钟前
将docker镜像上传到github镜像存储仓库(GitHub 容器仓库(GHCR)使用流程)
docker·容器·github
向依阳17 分钟前
RV1126准备-----编译和测试SDK自带的RKNN例程
linux·rv1226
我是谁??20 分钟前
Rocky9+ Docker + 容器内Linux桌面环境 + Web远程
运维·docker·容器
the sun3434 分钟前
Linux驱动开发:环境准备与报错处理
linux·运维·服务器
MC_J42 分钟前
Linux 6.1 移植RTL8723du驱动
linux·arm
姓王名礼1 小时前
这是一个完整的全栈交付包,包含Vue3 前端交互界面(集成数字人视频流、ECharts 图表、语音对话)和Docker Compose 一键部署脚本。
前端·docker·echarts
彭泽布衣1 小时前
Linux如何指定源端口打流
linux·运维·网络
晨晖21 小时前
Linux命令3
linux·运维·服务器
eggwyw1 小时前
Redis 设置密码(配置文件、docker容器、命令行3种场景)
数据库·redis·docker