Created
July 13, 2017 20:18
-
-
Save r-brown/31209ddb42dd770e5315359fca89b326 to your computer and use it in GitHub Desktop.
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 | |
# Сlear containers: | |
docker rm -f $(docker ps -a -q) | |
# Сlear images: | |
docker rmi -f $(docker images -a -q) | |
# Remove all the dangling images: | |
docker rmi $(docker images -q -f dangling=true) | |
# Сlear volumes: | |
docker volume rm $(docker volume ls -q) | |
# Сlear 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