Skip to content

Instantly share code, notes, and snippets.

@GnsP
Created March 9, 2018 06:57
Show Gist options
  • Save GnsP/81f6ef9e592117d8f2b5d98cf64e5c99 to your computer and use it in GitHub Desktop.
Save GnsP/81f6ef9e592117d8f2b5d98cf64e5c99 to your computer and use it in GitHub Desktop.
Clean docker space for mac osx
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs docker rmi
# remove unused volumes:
docker volume ls -qf dangling=true | xargs docker volume rm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment