Last active
August 29, 2015 14:21
-
-
Save warmwaffles/09ca7f28f08c682c5710 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 | |
| set -e | |
| echo "==> Cleaning..." | |
| docker rm $(docker ps -a -q | |
| echo "==> Complete" |
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 | |
| set -e | |
| echo "==> Nuking docker..." | |
| echo "==> Stopping containers..." | |
| docker stop $(docker ps -a -q) | |
| echo "==> Removing containers..." | |
| docker rm -f $(docker ps -a -q) | |
| echo "==> Removing unnamed containers..." | |
| docker images | grep "<none>" | awk '{ print "docker rmi " $3 }' | bash | |
| echo "==> Complete" |
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 | |
| set -e | |
| echo "==> Stopping all containers..." | |
| docker stop $(docker ps -q -a) | |
| echo "==> Complete" |
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 | |
| # goes in bashrc | |
| docker() { | |
| if command -v "docker-$1" > /dev/null 2>&1; then | |
| subcommand=$1 | |
| shift | |
| docker-$subcommand $@ | |
| else | |
| $(which docker) $@ | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment