What is the procedure to uninstall Docker on CentOS?
To uninstall Docker on CentOS, you can follow these steps:
- Stop and delete all running containers.
sudo docker stop $(sudo docker ps -a -q)
sudo docker rm $(sudo docker ps -a -q)
- Remove all images.
sudo docker rmi $(sudo docker images -q)
- Uninstall the Docker package.
sudo yum remove docker-ce
- Remove Docker data directory (optional):
sudo rm -rf /var/lib/docker
- Remove Docker configuration file (optional):
sudo rm -rf /etc/docker
After completing the above steps, Docker has been completely uninstalled from the CentOS system.