Skip to content

Instantly share code, notes, and snippets.

@jayme-github
Last active March 1, 2016 20:46
Show Gist options
  • Select an option

  • Save jayme-github/04845e0b3447c4248790 to your computer and use it in GitHub Desktop.

Select an option

Save jayme-github/04845e0b3447c4248790 to your computer and use it in GitHub Desktop.
docker exec bash shorthand with bash completion for container names
function docker-shell(){
# $1 == container
docker exec -ti "$1" env TERM=xterm bash -l
}
_docker-shell(){
local cur=${COMP_WORDS[COMP_CWORD]}
__docker_complete_container_names
}
complete -F _docker-shell docker-shell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment