Skip to content

Instantly share code, notes, and snippets.

@randomcamel
Created January 5, 2022 20:31
Show Gist options
  • Save randomcamel/07ec8fa5f96be7b96817bd58eeaeb11d to your computer and use it in GitHub Desktop.
Save randomcamel/07ec8fa5f96be7b96817bd58eeaeb11d to your computer and use it in GitHub Desktop.
docker-sh () {
dockershell=${2:-bash}
cmd="docker exec -it $1 /bin/$dockershell"
echo "running '$cmd' (-i -> interactive, -t -> allocate a tty)"
eval $cmd
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment