Last active
January 10, 2018 14:05
-
-
Save albertmatyi/9438d9ea9ae2d287e75181e81f2204fa to your computer and use it in GitHub Desktop.
Open a bash in local docker instance aka. "ssh into local docker instance"
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 -xe | |
# docker id might be given as a parameter | |
DID=$1 | |
if [[ "$DID" == "" ]]; then | |
# if no id given simply just connect to the first running instance | |
DID=$(docker ps | grep -Eo "^[0-9a-z]{8,}\b") | |
fi | |
docker exec -i -t $DID bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment