Skip to content

Instantly share code, notes, and snippets.

@xxorax
Forked from saitodev/docker-nsenter
Last active August 29, 2015 14:24
Show Gist options
  • Save xxorax/4acf645d164519d4d1ce to your computer and use it in GitHub Desktop.
Save xxorax/4acf645d164519d4d1ce to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
container_id=$1
if [ -z $container_id ]; then
echo "usage: sudo docker-nsenter <container_id> [args ...]"
exit 1
fi
target=`docker inspect --format '{{.State.Pid}}' $container_id`
nsenter --mount --uts --ipc --net --pid --target $target ${@:2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment