Created
January 30, 2015 14:34
-
-
Save hazbo/67735884dfa9c2dfaf6e to your computer and use it in GitHub Desktop.
A small script to remove (force) a container if it exists
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 | |
CONTAINER=$1 | |
RUNNING=$(docker inspect --format="{{ .State.Running }}" $CONTAINER 2> /dev/null) | |
if [ $? -eq 1 ]; then | |
echo "'$CONTAINER' does not exist." | |
else | |
/usr/bin/docker rm --force $CONTAINER | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment