Last active
May 20, 2020 19:48
-
-
Save jesugmz/170dae1804474490ecc28a4925af1042 to your computer and use it in GitHub Desktop.
Delete the whole Docker data created by the user. TAKE CARE!!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Delete the whole data created by the user. TAKE CARE!!! | |
# | |
# kill all running containers | |
docker kill $(docker ps -q) | |
# delete all containers | |
docker rm $(docker ps -aq) | |
# delete all images | |
docker rmi $(docker images -q) | |
# delete all volumes | |
docker volume rm $(docker volume ls -qf dangling=true) | |
# delete all networks | |
docker network rm $(docker network ls -q) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To just clean unnecesary data run
docker system prune
.