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

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.

主站蜘蛛池模板: 资源县| 简阳市| 玛沁县| 隆安县| 蒲江县| 左权县| 道真| 永嘉县| 松原市| 博野县| 洪洞县| 勃利县| 上高县| 永善县| 东乌珠穆沁旗| 卓尼县| 鄂伦春自治旗| 额尔古纳市| 嫩江县| 哈巴河县| 太原市| 梁河县| 宜州市| 武邑县| 云浮市| 昌平区| 陇川县| 瓦房店市| 尼木县| 肇源县| 勐海县| 曲沃县| 宜阳县| 称多县| 黔东| 虹口区| 边坝县| 墨脱县| 新化县| 普安县| 孝义市|