【Bug:docker】--Docker国内镜像源加载失败

报错信息

Error response from daemon: Get "https://registry-1.docker.io/v2/": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

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)

Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp 173.244.217.42:443: i/o timeout (Client.Timeout exceeded while awaiting headers)

自2024年6月6日起,Docker Hub在中国大陆地区被屏蔽,导致直接拉取镜像时出现"Connection reset by peer"等错误。本文教你解决在国内环境中无法正常使用Docker。

1.配置国内镜像

修改Docker配置文件,使用国内镜像源:

bash 复制代码
# 创建或编辑配置文件
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
    "registry-mirrors": [
        "https://docker.m.daocloud.io",
        "https://dockerproxy.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.nju.edu.cn",
        "https://mirror.baidubce.com"
    ]
}
EOF

# 重启Docker服务
sudo systemctl daemon-reload
sudo systemctl restart docker

但是今天在的测试的时候发现拉取镜像还是会失败,并且报错

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)

但是测试hello-world又是可以的

我以为是镜像源加载失败了,但是发现根本就不是,去官网查看发现这个镜像根本不存在,所以拉取镜像一定要查看名称:在镜像官网

https://hub.docker.com/r/lmsysorg/sglang/tags?name=cu124

相关推荐
BullSmall1 天前
Anolis OS 8.10 完整安装 Docker CE(生产可用,解决 podman 冲突)
docker·容器·podman
梦梦代码精1 天前
开源AI应用平台BuildingAI解析:插件化架构、应用市场与热门案例
人工智能·机器学习·docker·开源
IT瑞先生1 天前
Docker快速部署Mysql的三种方法——实操篇
mysql·adb·docker
梦远青城1 天前
Docker 部署python的paddle进行OCR文字识别身份证
python·docker·ocr·paddle·身份证识别
CodexDave1 天前
数据库连接池耗尽:排查顺序与三层兜底
服务器·前端·数据库·git·云原生·容器·kubernetes
java_logo1 天前
ELK Docker Compose 部署指南:轻松搭建日志检索平台
elk·elasticsearch·docker·容器·kibana·logstash·轩辕镜像
ShallWeL1 天前
Orin 上用 Docker 跑通目标检测功能
人工智能·目标检测·docker·容器
辰同学ovo1 天前
用“舞台换景”讲清 Docker 的 Restart 与 Recreate
运维·docker·容器
名字还没想好☜1 天前
Kubernetes Ingress 实战:域名路由、TLS 证书与 502/404 排查
运维·云原生·容器·kubernetes·ingress
看-是灰机1 天前
使用go语言实现对接
linux·开发语言·后端·docker·语言模型·golang·飞书