Created
September 24, 2019 16:06
-
-
Save twentythousandphantoms/19f396ac54e460a085bc4d6a422c383d to your computer and use it in GitHub Desktop.
/bin/docker-enter
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
#!/bin/sh | |
CONTAINER="${1}" | |
SHELL="${2:-/bin/sh}" | |
if [ -z "${CONTAINER}" ]; then | |
echo "You have not provided the container name or id!" | |
docker ps --format "{{.Names}}" | |
exit $? | |
fi | |
docker exec -t -i "${CONTAINER}" "${SHELL}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment