Skip to content

Instantly share code, notes, and snippets.

@yarimadam
Last active July 6, 2018 07:34
Show Gist options
  • Save yarimadam/df185482a1cc96ab697d0262436b782d to your computer and use it in GitHub Desktop.
Save yarimadam/df185482a1cc96ab697d0262436b782d to your computer and use it in GitHub Desktop.
bash inside docker container
# put inside ~/.profile or ~/.bashrc
goinside(){
docker exec -it $1 bash -c "stty cols $COLUMNS rows $LINES && bash";
}
_goinside(){
COMPREPLY=( $(docker ps --format "{{.Names}}" -f name=$2) );
}
complete -F _goinside goinside;
export -f goinside;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment