1. 卸载旧版本
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
2. 安装gcc相关
yum -y install gcc
yum -y install gcc-c++
3. 安装需要的软件包
sudo yum install -y yum-utils
4. 设置docker镜像源
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
5. 更新yum软件包索引
6. 安装DOCKER CE
7.
#关闭
systemctl stop firewalld
# 禁止开机启动防火墙
systemctl disable firewalld
8. 启动docker
9.测试
docker run hello-world
10.卸载
systemctl stop docker
yum remove docker-ce docker-ce-cli containerd.io
rm -rf /var/lib/docker
rm -rf /var/lib/containerd