Docker pull镜像timeout

tech2026-02-08  2

执行一下命令时报错:

docker run hello-world

错误信息如下:

Unable to find image 'hello-world:latest' locally 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). See 'docker run --help'.

解决方法

添加镜像加速器

sudo vim /etc/docker/daemon.json { "registry-mirrors": [ "此处写镜像源地址" ] }

Docker镜像源地址

镜像名称链接官方国内镜像https://registry.docker-cn.com网易http://hub-mirror.c.163.com中国科技大学https://docker.mirrors.ustc.edu.cn

重新加载配置文件并重启Docker

sudo systemctl daemon-reload sudo systemctl restart docker

校验是否存在

sudo docker info
最新回复(0)