在ubuntu安装好docker使用hello-world测试,但报错
sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
719385e32844: Retrying in 1 second
docker: error pulling image configuration: download failed after attempts=6: dial tcp 104.18.122.25:443: i/o timeout.
See 'docker run --help'.
我的解决方法是多配置几个加速镜像地址
先访问容器镜像服务 (aliyun.com)获取自己阿里云加速器地址,再去网上找一些加速地址
sudo mkdir -p /etc/docker
sudo nano /etc/docker/daemon.json
{"registry-mirrors": [
"https://xxxxxxx.mirror.aliyuncs.com", #改成自己的阿里云加速器地址
"https://docker.rainbond.cc",
"https://do.nark.eu.org",
"https://dc.j8.work",
"https://docker.m.daocloud.io",
"https://dockerproxy.com",
"https://registry.docker-cn.com",
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://docker.nju.edu.cn"
]
}
sudo systemctl daemon-reload
sudo systemctl restart docker
这时候再拉去镜像就不会报错了
sudo docker run hello-world