docker pull image 报错 dial tcp 31.13.88.169:443: i/o timeout

作者 : admin 本文共735个字,预计阅读时间需要2分钟 发布时间: 2024-06-10 共1人阅读

一、错误重现

error pulling image configuration: download failed after attempts=6: dial tcp 31.13.88.169:443: i/o timeout

在执行docker build构建镜像,拉取镜像时报错

docker pull image 报错 dial tcp 31.13.88.169:443: i/o timeout插图

或者直接docker pull镜像时报错

docker pull image 报错 dial tcp 31.13.88.169:443: i/o timeout插图(1)
实质都是拉取镜像源超时报错,那么就是镜像源的问题

二、解决方法

1、配置镜像源

vim /etc/docker/daemon.json

输入以下内容

{
	"registry-mirrors":[
		"http://i1el1i0w.mirror.aliyuncs.com",
		"http://hub-mirror.c.163.com",
		"http://registry.aliyuncs.com",
		"http://registry.docker-cn.com",
		"http://docker.mirrors.ustc.edu.cn"
	]
}

或者直接使用tee命令添加(二选一即可)

sudo tee /etc/docker/daemon.json <<-'EOF'
{
	"registry-mirrors":[
		"http://i1el1i0w.mirror.aliyuncs.com",
		"http://hub-mirror.c.163.com",
		"http://registry.aliyuncs.com",
		"http://registry.docker-cn.com",
		"http://docker.mirrors.ustc.edu.cn"
	]
}
EOF

2、重启docker服务

重启守护进程

sudo systemctl daemon-reload

重启服务

sudo systemctl restart docker

再次尝试成功了

本站无任何商业行为
个人在线分享 » docker pull image 报错 dial tcp 31.13.88.169:443: i/o timeout
E-->