官术网_书友最值得收藏!

Host

This type of network just puts the container in the host's network stack. That is, all of the network interfaces defined on the host will be accessible to the container, as you can see in the following diagram:

If you start your container using the -net=host option, then the container will use the host network. It will be as fast as normal networking: there is no bridge, no translation, nothing. That's why it can be useful when you need to get the best network performance. Containers running in the host's network stack will achieve faster network performance compared to those running on bridge networking, there is no need to traverse the docker0 bridge and iptables port mappings. In host mode, the container shares the networking namespace of the host (your local machine, for example), directly exposing it to the outside world. By using the -net=host command switch, your container will be accessible through the host's IP address. However, you need to be aware that this can be dangerous. If you have an application running as root and it has some vulnerabilities, there will be a risk of a security breach, as someone can get remote control of the host network via the Docker container. Using the host network type also means that you will need to use port mapping to reach services inside the container. We are going to cover port mapping later, in this chapter.

主站蜘蛛池模板: 冀州市| 怀安县| 揭西县| 新巴尔虎左旗| 涿州市| 左贡县| 长兴县| 阳春市| 新安县| 开封县| 确山县| 内乡县| 徐水县| 宁乡县| 清原| 美姑县| 阳原县| 密山市| 荆州市| 鄂托克前旗| 西乌珠穆沁旗| 北碚区| 米林县| 赞皇县| 吴桥县| 平谷区| 沙湾县| 手游| 石楼县| 万山特区| 金湖县| 政和县| 阿拉善右旗| 绥化市| 德惠市| 海淀区| 禄劝| 喀喇沁旗| 上杭县| 常州市| 滕州市|