Created
March 1, 2018 15:40
-
-
Save thekvs/7dd10858fc90bf595834a9c226c33268 to your computer and use it in GitHub Desktop.
Remove all docker images
This file contains hidden or 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 | |
# clear containers | |
docker rm -f $(docker ps -a -q) | |
# clear images | |
docker rmi -f $(docker images -a -q) | |
# clear volumes: | |
docker volume rm $(docker volume ls -q) | |
# clear networks: | |
docker network rm $(docker network ls | tail -n+2 | awk '{if($2 !~ /bridge|none|host/){ print $1 }}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment