Created
February 20, 2015 22:53
-
-
Save nb/e6698066e0b0d686a026 to your computer and use it in GitHub Desktop.
ssh into a container for debugging
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
# look for the ID of the `default` VM | |
vagrant global-status | |
vagrant ssh <default-id> | |
# install nsenter | |
docker run -v /usr/local/bin:/target jpetazzo/nsenter | |
# get the container id, not the image id | |
docker ps | |
PID=$(docker inspect --format {{.State.Pid}} <container-id>) | |
sudo nsenter --target $PID --mount --uts --ipc --net --pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment