Repository: stratos Updated Branches: refs/heads/master a008915eb -> e3b4177cf
add script to run docker nsenter command Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/e3b4177c Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/e3b4177c Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/e3b4177c Branch: refs/heads/master Commit: e3b4177cf6b5a6d314cc51ab0c1986ac933ee10d Parents: a008915 Author: Chris Snow <[email protected]> Authored: Sat Aug 30 20:45:19 2014 +0000 Committer: Chris Snow <[email protected]> Committed: Sat Aug 30 20:45:19 2014 +0000 ---------------------------------------------------------------------- tools/stratos-docker-images/run-nsenter.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/e3b4177c/tools/stratos-docker-images/run-nsenter.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-docker-images/run-nsenter.sh b/tools/stratos-docker-images/run-nsenter.sh new file mode 100755 index 0000000..c0a185b --- /dev/null +++ b/tools/stratos-docker-images/run-nsenter.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +container_id="$1" + +[ $# -eq 0 ] && { echo "Usage: $0 container_id"; exit 1; } + +if [ ! -e /usr/local/bin/nsenter ]; then + docker run --rm -v /usr/local/bin:/target jpetazzo/nsenter +fi + +PID=$(docker inspect --format {{.State.Pid}} $container_id) + +nsenter --target $PID --mount --uts --ipc --net --pid
