编写/etc/docker/daemon.json 文件
[root@yan docker]# cat /etc/docker/daemon.json # daemon.json 阿里云加速器
{"registry-mirrors": [
"https://kfwkfulq.mirror.aliyuncs.com",
"https://2lqq34jg.mirror.aliyuncs.com",
"https://pee6w651.mirror.aliyuncs.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"http://10.0.0.8.m.daocloud.io"
],
"dns": ["8.8.8.8","8.8.4.4"]
}
[root@yan docker]#
[root@yan docker]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo # 配置阿里云加速器
已加载插件:fastestmirror
adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
[root@yan docker]# systemctl restart docker # 重启 docker ,阿里云加速器生效
[root@yan docker]#
[root@yan docker]# docker pull tomcat:8.5 # 拉去镜像,测试效果