先分析,docker目前分企业版dokcer-ee和社区版docker-ce,内核一样,就是更新和服务有差别。CE是免费的,也够用了。
systemctl stop docker
rpm -qa | grep docker [root@VM_0_11_centos docker]# rpm -qa | grep docker docker-ce-cli-1x.03.5-3.el7.x86_64 docker-ce-1x.03.5-3.el7.x86_64
yum remove docker
或者
[root@VM_0_11_centos ~]# yum remove docker-ce Loaded plugins: fastestmirror, langpacks Repository epel is listed more than once in the configuration Resolving Dependencies --> Running transaction check ---> Package docker-ce.x86_64 3:19.03.5-3.el7 will be erased --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================================================================================================== Package Arch Version Repository Size ==================================================================================================================================================================================== Removing: docker-ce x86_64 3:19.03.5-3.el7 @docker-ce-stable 104 M Transaction Summary ==================================================================================================================================================================================== Remove 1 Package Installed size: 104 M Is this ok [y/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Erasing : 3:docker-ce-19.03.5-3.el7.x86_64 1/1 Verifying : 3:docker-ce-19.03.5-3.el7.x86_64 1/1 Removed: docker-ce.x86_64 3:19.03.5-3.el7 Complete! [root@VM_0_11_centos ~]# yum remove docker-ce-cli.x86_64 Loaded plugins: fastestmirror, langpacks Repository epel is listed more than once in the configuration Resolving Dependencies --> Running transaction check ---> Package docker-ce-cli.x86_64 1:19.03.5-3.el7 will be erased --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================================================================================================== Package Arch Version Repository Size ==================================================================================================================================================================================== Removing: docker-ce-cli x86_64 1:19.03.5-3.el7 @docker-ce-stable 169 M Transaction Summary ==================================================================================================================================================================================== Remove 1 Package Installed size: 169 M Is this ok [y/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Erasing : 1:docker-ce-cli-19.03.5-3.el7.x86_64 1/1 Verifying : 1:docker-ce-cli-19.03.5-3.el7.x86_64 1/1 Removed: docker-ce-cli.x86_64 1:19.03.5-3.el7 Complete! [root@VM_0_11_centos ~]
删除Docker相关的所有镜像、容器、自定义配置等一系列文件
操作这个一定要慎重
$ sudo rm -rf /var/lib/docke
安装Docker CE的命令为:yum install docker-ce
安装Docker EE的命令为:yum install docker-ee
如果要安装特定版本:
yum install docker-ce-18.06.1.ce
安装yum-utils,它提供一个yum-config-manager单元,同时安装的device-mapper-persistent-data和lvm2用于储存设备映射(devicemapper)必须的两个软件包。
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
由于repo中默认只开启stable仓库,故这里安装的是最新稳19.03.5.ce-1.el7.centos。
systemctl start docker systemctl enable docker
查看docker版本
docker version
[root@VM_0_11_centos docker]# docker version Client: Docker Engine - Community Version: 19.03.5 API version: 1.40 Go version: go1.12.12 Git commit: 633a0ea Built: Wed Nov 13 07:25:41 2019 OS/Arch: linux/amd64 Experimental: false
通过unknown flag: --mount错误分析docker volumes 中 -v 和 -mount 区别
unknown flag: --mount故障排查及解决办法