Created
August 12, 2019 14:22
-
-
Save wmanth/1b66d05b173610c63669eaf460ae63b7 to your computer and use it in GitHub Desktop.
Remove exited docker containers
This file contains 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/sh | |
CONTAINERS=$(docker ps --all --quiet --filter status=exited) | |
if [ -z "$CONTAINERS" ] | |
then | |
echo Nothing to cleanup | |
else | |
echo Removing containers: | |
docker rm $CONTAINERS | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment