Created
April 4, 2018 03:58
-
-
Save selfup/66405f1303e65ab87b65e9f1ef1dfa8f 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
#!/usr/bin/env bash | |
PS_AQ=$(docker ps -aq) | |
IMAGES_Q=$(docker images -q) | |
if [ !$PS_AQ ] || [ !$IMAGES_Q ] | |
then | |
echo 'NOTHING TO STOP OR DELETE' | |
else | |
echo ' STOPPING ALL CONTAINERS' \ | |
&& docker stop $PS_AQ \ | |
&& echo 'DELETING ALL CONTAINERS' \ | |
&& docker rm $PS_AQ \ | |
&& echo 'DELETING ALL IMAGES' \ | |
&& docker rmi $IMAGES_Q | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment