【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

相关推荐
爱宇阳5 小时前
GitLab Docker Compose 迁移教程
docker·容器·gitlab
冲上云霄的Jayden8 小时前
ubuntu 22一步步 安装docker和配置使用国内源
linux·ubuntu·docker·国内源
javpy9 小时前
docker部署nacos报错 ‘env NACOS_AUTH_TOKEN must be set with Base64 String.‘
linux·docker·centos
舰长11510 小时前
k8s 持久化存储方案-NFS
云原生·容器·kubernetes
梁正雄14 小时前
扩展-docker-ovs编译
运维·docker·容器
凯子坚持 c17 小时前
通往Docker之路:从单机到容器编排的架构演进全景
docker·容器·架构
Fuly102417 小时前
使用docker本地部署dify
运维·docker·容器
遇见火星21 小时前
Ubuntu Docker 容器化部署教程
linux·ubuntu·docker
Panda__Panda1 天前
docker项目打包演示项目(数字排序服务)
运维·javascript·python·docker·容器·c#