yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install docker-ce docker-ce-cli containerd.io
systemctl start docker
systemctl status docker
# 关闭docker
systemctl stop docker
# 开机启动docker
systemctl enable docker
原文:https://www.cnblogs.com/niceyoo/p/13096181.html