1. 配置指定的yum源
wget -P /etc/yum.repos.d/ https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
2. 查看yum源支持的docker版本
yum list docker-ce --showduplicates | sort -r
3. 安装指定版本Docker (以19.03.9-3.el7为例)
- yum install docker-ce-19.03.9-3.el7 -y
- systemctl start docker
- systemctl enable docker
4. 查看docker版本
docker version
方法一:
- yum remove docker \
- docker-client \
- docker-client-latest \
- docker-common \
- docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine
方法二:
yum list installed | grep docker
- yum -y remove docker.x86_64
-
- ...
rm -rf /var/lib/docker