1. Kill all running containers
docker kill $(docker ps -a -q)
Copy the code
2. Delete all containers
docker rm $(docker ps -a -q)
Copy the code
3. Delete all mirrors
docker rmi $(docker images -q)
Copy the code
Stop the Docker service
systemctl stop docker
Copy the code
5. Delete the storage directory
rm -rf /etc/docker
rm -rf /run/docker
rm -rf /var/lib/dockershim
rm -rf /var/lib/docker
Copy the code
6. Uninstall docker
View the installed Docker package
yum list installed | grep docker
Copy the code
Uninstalling related packages
yum remove docker-ce-cli.x86_64 docker-ce.x86_64 containerd.io.x86_64
Copy the code