1、安装yum-util
yum install -y yum-utils
2、配置国内源
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3、更新yum缓存
yum makecache fast
4、安装docker
yum install -y docker-ce
5、启动docker
systemctl start docker
6、开机自启动
systemctl enable docker