docker安装
如果不清楚当前系统是否已安装docker按照步骤卸载安装。
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
rm -rf /etc/systemd/system/docker.service.d
rm -rf /var/lib/docker
rm -rf /var/run/docker
安装docker
## 安装所需工具
sudo yum install -y yum-utils
## 设置镜像---建议阿里云镜像
sudo yum-config-manager \
--add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
## 加速器地址
https://345p2sef.mirror.aliyuncs.com
## 4.阿里云镜像
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://345p2sef.mirror.aliyuncs.com"]
}
EOF
## 更新索引
sudo yum makecache fast
## 安装docker引擎
sudo yum install docker-ce docker-ce-cli containerd.io
## 平滑重载deamon-reload
sudo systemctl daemon-reload
## 启动docker
sudo systemctl start docker
## 重启docker
sudo systemctl restart docker