看docker介绍时 有使用网络名称空间 但使用 #ip netns list 查看 却没有查看到任何的名称空间
运行一个docker
[email protected]:~# docker run -i-t ubuntu:14.04 /bin/bash
[email protected]90e7e685ae31:/#
查看docker的进程
[email protected]:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
90e7e685ae31 ubuntu:14.04 "/bin/bash" About a minute ago Up About a minute laughing_ritchie
查看对应容器的进程号
[email protected]:~# dockerinspect 90e7e685ae31 |grep Pid
"Pid": 14903,
"PidMode": "",
"PidsLimit": 0,
[email protected]:~# ln -s /proc/14903/ns/net/var/run/netns/ubuntu
[email protected]:~# ip netns list
ubuntu (id: 0)
test
[email protected]:~# ip netns execubuntu ip a