Skip to content

Instantly share code, notes, and snippets.

@xiongchiamiov
Last active March 3, 2016 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiongchiamiov/d5c6eb69d58722111180 to your computer and use it in GitHub Desktop.
Save xiongchiamiov/d5c6eb69d58722111180 to your computer and use it in GitHub Desktop.
Dealing with docker's disk space issues

See how much space is available

[$]> docker info 2>/dev/null | grep 'Data Space'     
 Data Space Used: 107.4 GB                             
 Data Space Total: 107.4 GB                            
 Data Space Available: 20.05 MB                        

Delete old containers

[$]> docker ps -aq | xargs docker rm

Delete old containers and their volumes

[$]> docker ps -qa | xargs docker rm --volumes

Delete untagged images

[$]> docker images | grep '<none>' | awk '{print $3}' | xargs docker rmi

Delete all images

[$]> docker images -q | xargs docker rmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment