Last active
March 22, 2019 11:26
-
-
Save GeoffWilliams/4654f62f62f139a7ef63 to your computer and use it in GitHub Desktop.
Copy and paste into your .bashrc file to give a new docker subcommand 'docker bash'
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
| docker() { | |
| if [[ "$1" == "shell" ]]; then | |
| if [[ "$2" == "" ]]; then | |
| echo "usage: docker shell CONTAINER_ID" | |
| else | |
| command docker exec -ti $2 bash||sh | |
| fi | |
| else | |
| command docker "$@" | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment