Skip to content

Instantly share code, notes, and snippets.

@pnasrat
Created November 5, 2013 22:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pnasrat/7327338 to your computer and use it in GitHub Desktop.
Save pnasrat/7327338 to your computer and use it in GitHub Desktop.
Using nsenter and docker
/ # root@precise64:~/util-linux# docker ps
ID IMAGE COMMAND CREATED STATUS PORTS NAMES
71546cef7b56 busybox:latest sleep 3600 16 minutes ago Up 16 minutes pink_monkey
root@precise64:~/util-linux# docker inspect 71546cef7b56 | grep Pid
"Pid": 10614,
root@precise64:~/util-linux# ./nsenter --mount -t 10621 /usr/bin/sh
BusyBox v1.19.3 (Ubuntu 1:1.19.3-7ubuntu1.1) built-in shell (ash)
Enter 'help' for a list of built-in commands.
/ # ps
PID USER COMMAND
1 root sleep 3600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment