#安装docker
#安装依赖软件包
yum install -y yum-utils device-mapper-persistent-data lvm2
#安装docker yum 源
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
#查看所有docker 版本
yum list docker-ce --showduplicates | sort -r
#安装最新稳定版本docker
sudo yum install docker-ce -y
#迁移docker文件
cp -R /var/lib/docker ./
#添加配置文件,定义新的存储位置
touch /etc/systemd/system/docker.service.d/docker.conf
echo '[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --graph=/mnt/disk-ssd/docker --storage-driver=overlay2' >> /etc/systemd/system/docker.service.d/docker.conf
#刷新配置
systemctl daemon-reload
systemctl start docker
systemctl status docker