Skip to content

Instantly share code, notes, and snippets.

@joshes
Last active July 14, 2019 15:42
Show Gist options
  • Save joshes/9df9fecb2dff65c304733b3c91363d29 to your computer and use it in GitHub Desktop.
Save joshes/9df9fecb2dff65c304733b3c91363d29 to your computer and use it in GitHub Desktop.
# Show stats
sudo du -d1 -h /var/lib/docker | sort -h
# Cleanup images
sudo docker rmi $(sudo docker images --filter "dangling=true" -q --no-trunc)
# Cleanup volumes
sudo docker ps -a | awk 'NR>1 {print $1}' | xargs sudo docker rm
sudo docker volume rm $(sudo docker volume ls -qf dangling=true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment