1、使用官方一键安装脚本
curl -sSL https://get.docker.com/ | sh
若报错
package docker-ce-3:19.03.2-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
安装新版的containerd.io软件包
wget https://download.docker.com/linux/centos/7/x86_64/edge/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
yum -y install containerd.io-1.2.6-3.3.el7.x86_64.rpm
再次安装脚本
curl -sSL https://get.docker.com/ | sh
2、启动docker
systemctl start docker