Last active
April 1, 2021 11:01
-
-
Save beeva-manueldepaz/4640699504a897ea89c9091caf7778d8 to your computer and use it in GitHub Desktop.
Script to delete all the images, containers and logs (path oriented to OsX)
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/sh | |
# HowTo | |
# Put it at /usr/local/bin/armaggeDocker.sh | |
# Give permissions: chmod a+x /usr/local/bin/armaggeDocker.sh | |
# Delete containers | |
docker stop $(docker ps -a -q) | |
docker rm $(docker ps -a -q) | |
# Delete images | |
docker rmi $(docker images -q) | |
#docker rmi $(docker images -q --filter "dangling=true") | |
# Delete volumes | |
docker volume ls -q | xargs docker volume rmw | |
# Delete all logs | |
rm /Users/$(whoami)/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2 | |
rm /Users/$(whoami)/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/syslog | |
rm -rf /Users/$(whoami)/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/log | |
mkdir /Users/$(whoami)/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment