Created
October 21, 2014 19:53
-
-
Save cranst0n/9793f6be55b710e56d7d to your computer and use it in GitHub Desktop.
Bash alias for Docker 'nsenter' process
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
## Usage: dockerNS <name-of-Docker-container> | |
dockerNS() { | |
declare -r dockerName=$1 | |
declare -r containerPID=`docker inspect --format "{{ .State.Pid }}" $dockerName` | |
sudo nsenter --target "$containerPID" --mount --uts --ipc --net --pid | |
} | |
alias dockerNS=dockerNS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment