1,安装docker依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
2,加软件源(国外速度太慢)
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3,安装
yum makecache fast yum -y install docker-ce
4,启动docker
systemctl start docker
5,设置docker开机自启
sudo systemctl enable docker