Created
July 11, 2015 10:29
-
-
Save danwald/06ea9c643745bd53db69 to your computer and use it in GitHub Desktop.
open a bash shell in a docker container or latest one
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
function dbash(){ | |
if test -z "$1" | |
then | |
container=`docker ps -lq` | |
echo "Using last active container $container" | |
else | |
container=$1 | |
fi | |
docker exec -it $container bash | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment