Senior
What Docker network drivers do you know? What are they used for?
sobes.tech AI
Answer from AI
Docker supports several network drivers, each used for different scenarios:
- bridge — the default isolated network for containers on a single host. Containers in the same bridge network can communicate with each other.
- host — the container uses the host's network stack directly, without isolation. Increases performance but reduces security.
- overlay — allows creating a network that spans multiple hosts, used in Docker Swarm for cluster organization.
- macvlan — assigns a MAC address to the container and makes it visible in the physical network as a separate device.
- none — disables network connectivity for the container.
Example usage: for local development, bridge is usually suitable, while for distributed applications in production, overlay is preferred so containers on different servers can interact.