https://docs.docker.com/engine/install/centos/
https://docs.docker.com/engine/install/centos/#install-from-a-package
【卸载】
查看版本:docker version
1.停止所有正在运行的 docker 容器
docker ps
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
2.停止docker服务
sudo systemctl disable docker
sudo systemctl stop docker
sudo systemctl stop docker.socket
ps -ef|grep docker|grep -v grep
3.卸载服务
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine -y
sudo yum remove docker docker-client docker-client docker-common docker docker-logrotate docker-engine -y
sudo yum remove containerd.io.x86_64 -y
sudo yum remove docker-ce.x86_64 -y
sudo yum remove docker-ce-cli.x86_64 -y
sudo yum remove docker-ce-rootless-extras.x86_64 -y
sudo yum remove docker-compose-plugin.x86_64 -y
sudo yum remove docker-scan-plugin.x86_64 -y
4.删除残留文件
du -h --max-depth=1 /var/lib/docker
du -sh /var/lib/docker
sudo rm -rf /var/lib/docker
sudo rm -rf /etc/docker
rm -rf /var/lib/dockershim
sudo rm -rf /usr/lib/systemd/system/docker.socket
rm -rf /run/docker
5.检查卸载情况:docker version
docker version
[root@hecs-332226 docker]-bash: /usr/bin/docker: No such file or directory