Skip to content

Instantly share code, notes, and snippets.

@saitodev
Last active August 29, 2015 14:04
Show Gist options
  • Save saitodev/fd1e843638e46016cade to your computer and use it in GitHub Desktop.
Save saitodev/fd1e843638e46016cade to your computer and use it in GitHub Desktop.
#!/bin/bash
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