1、Centos7安装Docker
1.1 确定Centos版本是否是7及以上
cat /etc/redhat-release
1.2 卸载旧版本
sudo dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
1.3 yum安装gcc相关
yum -y install gcc
yum -y install gcc-c++
1.4 安装需要的软件包
yum install -y yum-utils
1.5 设置stable镜像仓库
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
1.6 更新yum软件包索引
yum makecache fast
1.7 安装DOCKER CE
yum -y install docker-ce docker-ce-cli containerd.io
1.7.1 执行结果
1.8 启动Docker
systemctl start docker
1.9 测试
docker version
1.9.1 测试结果
2、Centos7卸载Docker
systemctl stop docker
yum remove docker-ce docker-ce-cli containerd.io
rm -rf /var/lib/docker
rm -rf /var/lib/containerd