Bridge network (“–network bridge”, default)
Details
– Containers of this type are in the same network.
– Their network is bridged to the host network.
– They can communicate via published ports.
Example
192.168.0.0/24 Host Network ----------------------------- | | | 192.168.0.1 192.168.0.2 192.168.0.3 WiFi-Router Host Printer 172.17.0.1 | ----------------------------- | Bridge Network | | 172.17.0.0/16 | 172.17.0.2 172.17.0.3 Container_1 Container_2
The host operates as a component in the host network and as the gateway for the bridge network.
Host network (“–network host”)
Details
– Containers of this type share the host network.
– Pro: It provides a better performance.
– Con: It exposes more of the host network.
Example
192.168.0.0/24 Host Network --------------------------------------------------------- | | | | | 192.168.0.1 192.168.0.2 192.168.0.2 192.168.0.4 192.168.0.5 WiFi-Router Host Printer Container_1 Container_2
None network (“–network none”)
Details
– Containers of this type are completely isolated.
Example
192.168.0.0/24 Host Network ----------------------------- | | | 192.168.0.1 192.168.0.2 192.168.0.2 WiFi-Router Host Printer ------------- ------------- |Container_1| |Container_2| ------------- -------------