Skip to content

Instantly share code, notes, and snippets.

@tdiprima
Created June 28, 2017 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdiprima/9159998d0fa89303eac83d49c1eba6a2 to your computer and use it in GitHub Desktop.
Save tdiprima/9159998d0fa89303eac83d49c1eba6a2 to your computer and use it in GitHub Desktop.
Get into Docker container
#!/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
@tdiprima
Copy link
Author

Then in your .bashrc put something like:
alias getin="$HOME/scripts/getin.sh" $1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment