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

Bridge

This is the default network type in Docker. When the Docker service daemon starts, it configures a virtual bridge, named docker0. If you do not specify a network with the docker run -net=<NETWORK> option, the Docker daemon will connect the container to the bridge network by default. Also, if you create a new container, it will be connected to the bridge network. For each container that Docker creates, it allocates a virtual Ethernet device which will be attached to the bridge. The virtual Ethernet device is mapped to appear as eth0 in the container, using Linux namespaces, as you can see in the following diagram:

The in-container eth0 interface is given an IP address from the bridge's address range. In other words, Docker will find a free IP address from the range available on the bridge and will configure the container's eth0 interface with that IP address. From now on, if the new container wants to, for example, connect to the Internet, it will use the bridge; the host's own IP address. The bridge will automatically forward packets between any other network interfaces that are attached to it and also allow containers to communicate with the host machine, as well as with the containers on the same host. The bridge network will probably be the most frequently used one.

主站蜘蛛池模板: 丰原市| 江达县| 苏州市| 曲阳县| 平顺县| 宜君县| 扶风县| 金乡县| 公主岭市| 东乡| 云林县| 福贡县| 安宁市| 石狮市| 黄平县| 南汇区| 富顺县| 凌源市| 扶绥县| 泰来县| 勐海县| 同江市| 平远县| 东乡县| 西盟| 辽源市| 新龙县| 元阳县| 札达县| 木里| 吉林省| 武夷山市| 高唐县| 三原县| 革吉县| 台湾省| 新乐市| 四平市| 齐河县| 阜南县| 平阳县|