1、使yum的CentOS-Extras配置生效
文件CentOS-Base.repo中enabled的値从0变成1
vim /etc/yum.repos.d/CentOS-Base.repo
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1 ★ 値从0变成1
※Docker is included by default in the CentOS-Extras repository
2、执行yum 安装
# yum install docker
3、Docker启动
# systemctl start docker