"Docker" Docker host why IP nets cannot find network space

Source: Internet
Author: User
Tags nets

When you create a Docker container, you should have a new namespace (if you have a separate network), you can see the namespace through the IP netns command, but you can't actually see it.

After checking the data, we found that IP netns can only view the network namespace below/var/run/netns. Unlike OpenStack Neutron, Docker automatically creates namespace names in this file and needs to be created manually.

The creation method is:

pid=`docker inspect -f ‘{{.State.Pid}}‘ $container_id`ln -s /proc/$pid/ns/net /var/run/netns/$container_id


References:
IP netns use: http://blog.csdn.net/ptmozhu/article/details/52386275
Reason: http://blog.csdn.net/liuliuzi_hz/article/details/51699932
http://blog.csdn.net/liuliuzi_hz/article/category/6065584
http://blog.csdn.net/liuliuzi_hz/article/details/50601521
http://blog.csdn.net/liuliuzi_hz/article/details/50594595
http://blog.csdn.net/liuliuzi_hz/article/details/50593613
container configuration: http://blog.csdn.net/liuliuzi_hz/article/details/50593599
http://unix.stackexchange.com/questions/113530/how-to-find-out-namespace-of-a-particular-process
http://blog.csdn.net/smallfish1983/article/details/38701067

"Docker" Docker host why IP nets cannot find network space

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.