Created
August 25, 2019 16:49
-
-
Save ttonyh/ba2d4e21810eac8b9b6cbbfdf5e3c81d 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
dockerstop () { | |
local ID=`docker ps -aqf name=$1` | |
if [ ! -z "$ID" ] | |
then | |
echo "STOPING/REMOVING CONTAINER: $ID ($1)..." | |
docker stop "$ID" && docker rm "$ID" | |
else | |
echo "CONTAINER '$1' NOT FOUND" | |
fi | |
} | |
dockerexec () { | |
local ID=`docker ps -aqf name=$1` | |
if [ ! -z "$ID" ] | |
then | |
echo "ABOUT TO RUN CONTAINER: $ID ($1)..." | |
docker exec -it "$ID" /bin/sh | |
else | |
echo "CONTAINER '$1' NOT FOUND" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment