Skip to content

Instantly share code, notes, and snippets.

@akoskovacs
Created December 26, 2023 09:09
Show Gist options
  • Save akoskovacs/d509eb133a5525da137fb0c94417242a to your computer and use it in GitHub Desktop.
Save akoskovacs/d509eb133a5525da137fb0c94417242a to your computer and use it in GitHub Desktop.
Prune all unused docker containers and images
#!/bin/bash
# Dump current disk usage
df -h
# Remove unused containers
yes | docker container prune
# Remove unused images
yes | docker image prune -a
# Dump saved disk space
df -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment