Skip to content

Instantly share code, notes, and snippets.

@danwald
Created July 11, 2015 10:29
Show Gist options
  • Save danwald/06ea9c643745bd53db69 to your computer and use it in GitHub Desktop.
Save danwald/06ea9c643745bd53db69 to your computer and use it in GitHub Desktop.
open a bash shell in a docker container or latest one
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