背景说明

鉴于国内网络稳定问题,到国外站点拉取docker镜像十分缓慢,故需要配置国内镜像以便提高镜像下载速度。

1.使用这个url地址https://account.daocloud.io/signin注册一个账号并登录

2.点击右上角箭头标记的加速选项

3.复制下面的命令

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://ce802703.m.daocloud.io

并在学习机器环境上执行

[root@docker ~]# curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://ce802703.m.daocloud.io
docker version >= 1.12
{"registry-mirrors": ["http://ce802703.m.daocloud.io"]}
Success.
You need to restart docker to take effect: sudo systemctl restart docker 
[root@docker ~]# systemctl restart docker
[root@docker ~]# 

说明:

该脚本可以将 --registry-mirror 加入到你的 Docker 配置文件 /etc/docker/daemon.json 中。适用于 Ubuntu14.04、Debian、CentOS6 、CentOS7、Fedora、Arch Linux、openSUSE Leap 42.1