Created
May 20, 2021 12:16
-
-
Save jimmyadaro/51157e435ca64cd3c7000cc1070e56ec to your computer and use it in GitHub Desktop.
Execute a Docker container with bash as shell (using an alias)
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
# I'm using .zshrc but should be valid in any sh or bash shell | |
alias dexec='(){docker exec -it $1 /bin/bash;}' | |
# Use it like this: | |
# dexec <container name or ID> | |
# dexec my_website | |
# dexec ea2bdf44 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment