Created
May 28, 2015 14:38
-
-
Save vitaly/9aeeba4cd2024b4580ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# cleanup all stopped containers | |
# except for those that have 'data' in the name | |
echo Removing all stopped non-data containers | |
docker ps --filter "status=exited" \ | |
| grep -v data \ | |
| grep -v ^CONTAINER \ | |
| awk '{print $1}' \ | |
| xargs docker rm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment