yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
PS:安装docker-ce(社区版),EE版要收费的
yum makecache fast
yum -y install docker-ce
systemctl start docker
systemctl enable docker
docker version
mkdir -p /**opt**/**data**/docker
systemctl disable docker
systemctl enable docker
#显示结果
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
vim /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd --graph /opt/data/docker
systemctl disable docker
systemctl enable docker
systecmtl daemon-reload
systemctl start docker
看到下面这个就说明成功了
Docker Root Dir:/opt/data/docker