1、停止docker服务
# 删掉容器
docker ps -a -q | xargs docker rm
# 删掉镜像
docker rmi $(docker images -q)
# 停止服务
systemctl stop docker
2、删掉相关目录
rm -rf /etc/docker
rm -rf /run/docker
rm -rf /var/lib/dockershim
rm -rf /var/lib/docker
3、查看docker安装包,并删掉
yum list installed | grep docker
yum remove containerd.io.x86_64 docker-buildx-plugin.x86_64 docker-ce.x86_64 docker-ce-cli.x86_64 docker-ce-rootless-extras.x86_64 docker-compose-plugin.x86_64 docker-scan-plugin.x86_64
4、查看是否删除干净
docker version