Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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