𝗡𝗲𝘁𝘄𝗼𝗿𝗸𝘀 𝗶𝗻 𝗗𝗼𝗰𝗸𝗲𝗿 :-
𝑩𝒓𝒊𝒅𝒈𝒆:-
The default networking driver in Docker. This allows containers on the same host to talk to each other. If container A and B are on the same Bridge network, they can talk to each-other.
But if they’re on different bridge networks, they cannot talk to each other.
When you create a new network, unless you specify a different driver, it will be a Bridge network. Docker already creates one bridge network for you when you install it. And when you run a new container on your system, by default it connects to this bridge network.
𝑯𝒐𝒔𝒕 :-
The host network driver can be used to remove network isolation between the container and its host machine. Unlike in bridge, a host network Container doesn’t get its own IP address. When it binds to a port, it is directly the host port. Host mode is useful for better performance because there’s no additional network layer in between. But it only works on Linux unless you use Docker Desktop.
𝑶𝒗𝒆𝒓𝒍𝒂𝒚 :-
Overlay networks allow Docker containers on different host machines to talk to each other. They connect the Docker daemons running on these hosts to each other. This allows you to scale out horizontally. You don’t have to deploy all your containers on the same server.
𝑵𝒐𝒏𝒆 :-
This means your container does not have any network and it is completely isolated from the host as well as other containers. This is more secure than the other drivers since all network communication is disabled. But of course, it is only good for some use cases.