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: TLS handshake timeout. See 'docker run --help'.
报错原因:镜像可能配置的是国外的,下载过慢,请求失败
解决办法:修改镜像地址
#进入/ect/docker目录下
cd /etc/docker
#创建daemon.json文件
touch daemon.json
#编辑daemon.json文件
vim daemon.json
在文件中添加国内镜像地址:
{
"registry-mirrors":["http://hub-mirror.c.163.com"]
}
重启docker并测试:
systemctl restart docker
wuhu!