Skip to content

Instantly share code, notes, and snippets.

@chrisloy
Created December 7, 2016 11:13
Show Gist options
  • Save chrisloy/4256f5d97e397161f06481b52c57cd47 to your computer and use it in GitHub Desktop.
Save chrisloy/4256f5d97e397161f06481b52c57cd47 to your computer and use it in GitHub Desktop.
Removes all images and temporary files from Docker (Mac)
#!/bin/bash
read -r -p "Are you sure? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
echo "Burning the world...."
docker rm $(docker ps -a -q)
docker rmi -f $(docker images -q)
rm -rf ~/Library/Containers/com.docker.docker/Data/*
;;
*)
echo "Stand down, gentlemen"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment