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

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.

主站蜘蛛池模板: 洪雅县| 沅江市| 平果县| 紫阳县| 永顺县| 体育| 库尔勒市| 闸北区| 翼城县| 藁城市| 旌德县| 华蓥市| 万山特区| 扎兰屯市| 新野县| 北辰区| 柳江县| 玉门市| 长宁县| 喜德县| 通海县| 彭阳县| 万荣县| 丰原市| 河北区| 华亭县| 广南县| 林甸县| 沿河| 大足县| 商水县| 霞浦县| 江孜县| 永兴县| 延安市| 遵义市| 白水县| 扬中市| 萍乡市| 奉化市| 宁晋县|