Created
February 17, 2015 10:31
-
-
Save abraverm/446f5f3c963e64b44722 to your computer and use it in GitHub Desktop.
Run commands and enter Docker conatiner without using SSH: $ cmd_docker <CONTAINER NAME> /bin/bash
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
| #!/bin/bash | |
| CONTAINER=$1 | |
| COMMAND=$2 | |
| ID=`docker inspect --format '{{ .State.Pid }}' $CONTAINER` | |
| sudo nsenter -m -u -n -i -p -t $ID $COMMAND |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment