Trying to understand Docker Networks. Docker creates the following networks automatically:
# docker network ls
NETWORK ID NAME DRIVER SCOPE
67b4afa88032 bridge bridge local
c88f997a2fa7 host host local
1df2947aad7b none null local
I understood that the bridge network represents the docker0 network present in all Docker installations, referring from the link.
Can someone help me in understanding other networks, host and none, If possible with examples?
Docker by default supports 3 networks:
1) None:
This mode will not configure any IP for the container and doesn’t have any access to the external network as well as for other containers. It does have the loopback address and can be used for running batch jobs.
2) Host
In this mode container will share the host’s network stack and all interfaces from the host will be available to the container. The container’s host name will match the host name on the host system
In host and none mode are not configured directly but default bridge network can be configured as well as create your own user-defined bridge networks.
3) Bridge Mode
It is the Docker default networking mode which will enable the connectivity to the other interfaces of the host machine as well as among containers.
Along with these docker provides MACVLAN network which allows to configure multiple Layer 2(MAC) addresses on a single physical interface.