pull python 3.7报错:
尝试拉取Docker 测试库hello world也失败
尝试使用临时镜像源,可以成功拉取:
sudo docker pull docker.m.daocloud.io/hello-world
说明确实是网络问题,需要配置镜像源,为了方便,在daemon.json中添加镜像源来永久换源。
镜像源配置
参考该blog: https://blog.csdn.net/qq_73162098/article/details/145014490
创建目录:
sudo mkdir -p /etc/docker
添加mirrors
sudo tee /etc/docker/daemon.json <<-'EOF'
{"registry-mirrors": ["https://docker.m.daocloud.io","https://docker.imgdb.de","https://docker-0.unsee.tech","https://docker.hlmirror.com","https://docker.1ms.run","https://func.ink","https://lispy.org","https://docker.xiaogenban1993.com"]
}
EOF
重启
sudo systemctl daemon-reload && sudo systemctl restart docker
验证:
sudo docker pull hello-world
成功拉取:
可能需要手动去服务管理中重启docker service: