Skip to content

Instantly share code, notes, and snippets.

@r-brown
Created July 13, 2017 20:18
Show Gist options
  • Save r-brown/31209ddb42dd770e5315359fca89b326 to your computer and use it in GitHub Desktop.
Save r-brown/31209ddb42dd770e5315359fca89b326 to your computer and use it in GitHub Desktop.
#!/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