- 进入repo目录,下载阿里的ddocker repo
cd /etc/yum.repos.d/
wget http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
- 安装docker
yum install docker-ce -y
- 修改docker镜像地址
mkdir /etc/docker
vi /etc/docker/daemon.json
{
"registry-mirrors": ["https://tnxkcso1.mirror.aliyuncs.com"]
}
- 设置开机启动并重启docker
systemctl enable docker
systemctl restart docker