Created
June 28, 2017 15:20
-
-
Save tdiprima/9159998d0fa89303eac83d49c1eba6a2 to your computer and use it in GitHub Desktop.
Get into Docker container
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 | |
if [ $# -eq 0 ] | |
then | |
container_name="YOUR-CONTAINER" # change to whatever default container you like | |
else | |
container_name="$1" | |
fi | |
containerId=$(docker inspect --format '{{ .Id }}' "$container_name") | |
docker exec -it "$containerId" /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Then in your
.bashrc
put something like:alias getin="$HOME/scripts/getin.sh" $1