默认的docker镜像仓库在国外dockerhub,国内服务器下载速度非常非常慢,而且还会失败,可以使用阿里云镜像加速器,免费!亲测有效!
步骤一:创建阿里云账号
网址:http://dev.aliyun.com
按步骤注册,有淘宝、支付宝等用户也可以直接登陆
步骤二:进入阿里云控制台
步骤三:搜索容器镜像服务并访问
第一次访问可能有个注册的过程,输入密码就好
步骤三:点击镜像加速器
步骤四:配置加速
可以选择部署docker的系统版本,修改相关配置
我使用的是Centos
# vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://h8r0sjxo.mirror.aliyuncs.com"]
}
# systemctl restart docker
# docker pull kibana:latest
Trying to pull repository docker.io/library/kibana ...
latest: Pulling from docker.io/library/kibana
f189db1b88b3: Pull complete
8e4c00d0a2f1: Pull complete
ae50ad228104: Pull complete
228a7a369ee9: Pull complete
5272eb2224c2: Pull complete
b0a91590498c: Pull complete
4b8a31943945: Pull complete
df84b481e461: Pull complete
0863f2e045e0: Pull complete
Digest: sha256:8b3ea5e4974be2e916d5a5e7fbe2bd3a8f229c374525361372192736459083f9
Status: Downloaded newer image for docker.io/kibana:latest
这时就能看到下载镜像的速度有了明显加快