Skip to content

Instantly share code, notes, and snippets.

@mlen

mlen/denter Secret

Created October 30, 2017 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlen/5e95ca01ec034a3f60c9ad400b505de4 to your computer and use it in GitHub Desktop.
Save mlen/5e95ca01ec034a3f60c9ad400b505de4 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
if [ $# -ne 1 ]; then
echo "usage: $(basename "$0") CONTAINER"
exit 2
fi
pid=$(docker inspect --format "{{.State.Pid}}" "$1")
sudo nsenter --target "$pid" --mount --uts --ipc --net --pid /bin/sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment