Skip to content

Instantly share code, notes, and snippets.

@miyataka
Last active May 22, 2020 04:25
Show Gist options
  • Save miyataka/bf67be9aefb0fbc41094c7a26987342f to your computer and use it in GitHub Desktop.
Save miyataka/bf67be9aefb0fbc41094c7a26987342f to your computer and use it in GitHub Desktop.
docker-sh
# 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
}
@miyataka
Copy link
Author

you can easily access docker container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment