3 if [ "$1" == "" ]; then
4 echo "usage: $0 <container_name>"
5 echo "Exposes the netns of a docker container to the host"
9 pid=`docker inspect -f '{{.State.Pid}}' $1`
10 ln -s /proc/$pid/ns/net /var/run/netns/$1
12 echo "netns of ${1} exposed as /var/run/netns/${1}"
14 #echo "try: ip netns exec ${1} ip addr list"