Centos下完全删除docker
#结束所有docker容器
docker kill $(docker ps -a -q)
#删除所有docker容器
docker rm $(docker ps -a -q)
#删除所有docker镜像
docker rmi $(docker images -q)
#停止 docker 服务
systemctl stop docker
#删除docker相关存储目录
rm -rf /etc/docker
rm -rf /run/docker
rm -rf /var/lib/dockershim
rm -rf /var/lib/docker
#如果删除不掉,则先umount,再重复上面步骤
umount /var/lib/docker/devicemapper
#查看系统已安装的docker
yum list installed | grep docker
#卸载已安装的docker,按查看结果卸载
yum remove docker-ce-cli.x86_64
#再次查看检查,返回结果为空就是卸载干净了
yum list installed | grep docker
#重新安装最新版的docker-ce
yum install -y yum-utils yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum install docker-ce docker-ce-cli containerd.io docker --version systemctl start docker systemctl enable docker