Skip to content

Instantly share code, notes, and snippets.

@nb
Created February 20, 2015 22:53
Show Gist options
  • Save nb/e6698066e0b0d686a026 to your computer and use it in GitHub Desktop.
Save nb/e6698066e0b0d686a026 to your computer and use it in GitHub Desktop.
ssh into a container for debugging
# 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