Last active
May 22, 2020 04:25
-
-
Save miyataka/bf67be9aefb0fbc41094c7a26987342f to your computer and use it in GitHub Desktop.
docker-sh
This file contains 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
# requirement | |
# - peco command `brew install peco` | |
## docker-sh | |
function docker-sh() { | |
CONTAINER_ID=$(docker ps | sed -e '1d' | peco | cut -f1 -d' ') | |
if [[ -z $CONTAINER_ID ]]; then | |
return 1 | |
fi | |
docker exec -it $CONTAINER_ID sh | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can easily access docker container.