Last active
June 9, 2017 22:21
-
-
Save gullitmiranda/53488e29cd52c1b9a9685c65a0b49e7f to your computer and use it in GitHub Desktop.
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 | |
usage() { | |
echo " | |
sh <( curl -sSL https://gist.githubusercontent.com/gullitmiranda/53488e29cd52c1b9a9685c65a0b49e7f/raw/80fb0c4007b2c3964fc66f00312b50c15892fe3e/docker_dc.sh ) IMAGE_MATCH | |
" | |
} | |
IMAGE_MATCH=${1:-$IMAGE_MATCH} | |
if [[ -z "${IMAGE_MATCH}" ]]; then | |
usage() | |
exit 0; | |
fi | |
docker rm -f $(docker ps -f status=exited -q | tr '\r\n' ' ') $(docker ps -f status=created -q | tr '\r\n' ' ') | |
docker rmi $(docker images | grep ${IMAGE_MATCH} | awk '{print $3}' | tr '\r\n' ' ') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment