1 | initial version |
To remove all Docker data and initiate a fresh restart, follow these steps:
Stop all running Docker containers using the command docker stop $(docker ps -a -q)
.
Remove all Docker containers using the command docker rm $(docker ps -a -q)
.
Remove all Docker images using the command docker rmi $(docker images -q)
.
Remove all Docker volumes using the command docker volume rm $(docker volume ls -q)
.
Remove all Docker networks using the command docker network rm $(docker network ls -q)
.
Remove all related Docker files from the host machine using the command sudo rm -rf /var/lib/docker
(Note: this command will delete all Docker data from the machine).
Now, Docker is completely removed from your system. You can install Docker again and start with a fresh Docker environment.