Table of Contents

Docker - Networking - Docker Network Drivers

Docker offers multiple network drivers, each suited for different use cases.


Bridge Networks

Create a new bridge network:

docker network create my-bridge-network

Host Networks

Run a container using the host network:

docker run --network host my-image

Overlay Networks

Create an overlay network:

docker network create -d overlay my-overlay-network

Macvlan Networks

* Assigns a MAC address to each container, making it appear as a physical device on the network. * Containers can be directly connected to the physical network. * Useful for legacy applications requiring direct network access.

Create a macvlan network:

docker network create -d macvlan \
  --subnet=192.168.1.0/24 \
  --gateway=192.168.1.1 \
  -o parent=eth0 my-macvlan-network