Skip to content

Instantly share code, notes, and snippets.

@stonecharioteer
Forked from buckett/clean-docker.sh
Created March 3, 2022 04:43
Show Gist options
  • Save stonecharioteer/196e95f581d135ef2d38d15e489449b6 to your computer and use it in GitHub Desktop.
Save stonecharioteer/196e95f581d135ef2d38d15e489449b6 to your computer and use it in GitHub Desktop.
Cleans out old docker images and containers.
#!/bin/bash
# Clean all exited containers
docker ps -qaf status=exited | xargs docker rm
# Remove all unused images
docker images -f dangling=true -q | xargs docker rmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment