Docker 容器镜像拉取的问题 使用docker pull 或者 docker compose up -d 拉取镜像时,经常会遇到以下问题。
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)
原因是镜像源失效或者速率不够导致超时
绝大部分的文章都不用看,因为失效很快
可以在Github上关注这个项目随时更新源
https://github.com/dongyubin/DockerHub
然后修改本地daemon.json 配置
cat /etc/docker/daemon.json
1 2 3 4 5 6 7 { "registry-mirrors" : [ "https://docker.mybacc.com" , "https://docker.1ms.run" , "https://dytt.online" ] }
重启daemon和docker 服务
1 2 systemctl daemon-reload systemctl restart docker
顺便记录下Podman的源配置 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 [root@iZbp19tqlmjz1dmnm8w43uZ containers]# cat /etc/containers/registries.conf | grep -v "#" unqualified-search-registries = ["registry.access.redhat.com" , "registry.redhat.io" , "docker.io" ] [[registry]] prefix = "docker.io" location = "docker.1ms.run" insecure = false [[registry.mirror]] location = "docker.mybacc.com" insecure = false [[registry.mirror]] location = "docker.1ms.run" insecure = false [[registry.mirror]] location = "dytt.online" insecure = false short-name-mode = "permissive"