Skip to content

Instantly share code, notes, and snippets.

@haffla
Created October 6, 2016 11:43
Show Gist options
  • Save haffla/28b5c3f24a225f829aa8006a828338a3 to your computer and use it in GitHub Desktop.
Save haffla/28b5c3f24a225f829aa8006a828338a3 to your computer and use it in GitHub Desktop.
Remove old Docker containers and images
CONTAINERS:
docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm
IMAGES:
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment