Created
July 17, 2014 16:01
-
-
Save aweiteka/63b0a607a3ef142b974b to your computer and use it in GitHub Desktop.
drop into running docker container shell using nsenter
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
#!/usr/bin/env bash | |
# drop into running docker container shell | |
if [ -z "$1" ]; then | |
echo "USAGE: ./`basename $0` <container_id>" | |
exit 1 | |
fi | |
PID=$(docker inspect --format '{{ .State.Pid }}' $1) | |
nsenter -m -u -n -i -p -t $PID /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment