0% found this document useful (0 votes)
12 views6 pages

Docker Networking

The document provides an overview of different types of Docker networks, including Default Bridge, Host, Overlay, Macvlan, Custom Bridge, and None networks. Each network type has specific use cases, such as enabling communication between containers, sharing the host's network stack, or providing isolation. The document also includes example commands for creating and using these networks in Docker.

Uploaded by

vinsparky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views6 pages

Docker Networking

The document provides an overview of different types of Docker networks, including Default Bridge, Host, Overlay, Macvlan, Custom Bridge, and None networks. Each network type has specific use cases, such as enabling communication between containers, sharing the host's network stack, or providing isolation. The document also includes example commands for creating and using these networks in Docker.

Uploaded by

vinsparky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Docker

Networking
Notes
FOR DEVOPS ENGINEERS

Train With
Shubham
Docker Networking
Types of Networks in Docker

Default Bridge Network: The default network in Docker. It creates a


private network on the host machine. Containers connected to the
bridge network can communicate with each other using container names
as hostnames. IP addresses can also be used.

docker run --network=bridge my-container

Host Network: With this network mode, containers share the host's
network stack, bypassing network isolation. Containers using the host
network can access services running on the host directly without any
port mapping. This mode can be useful for performance-critical
applications or when network isolation is not a concern.

docker run --network=host my-container

Train With
Shubham
Docker Networking
Types of Networks in Docker

Overlay Network: Overlay networks are used for communication


between multiple Docker daemon hosts. This type of network allows
containers running on different hosts to communicate seamlessly as if
they were on the same network. Overlay networks use VXLAN (Virtual
Extensible LAN) encapsulation to achieve network connectivity across
multiple hosts.

docker network create --driver=overlay my-


overlay-network
docker service create --network=my-overlay-
network my-service

Train With
Shubham
Docker Networking
Types of Networks in Docker

Macvlan Network: Macvlan networks allow containers to have a MAC


address assigned directly to them. This allows containers to appear as
physical devices on the network, enabling them to be assigned IP
addresses from the physical network's subnet. It is particularly useful
when containers require direct Layer 2 network access or when you want
to connect containers directly to external networks.

docker network create -d macvlan --subnet=


<subnet> --gateway=<gateway> -o parent=
<network-interface> my-macvlan-network
docker run --network=my-macvlan-network my-
container

Train With
Shubham
Docker Networking
Types of Networks in Docker

Custon Bridge Network: It creates a private network on the host


machine, allowing containers to communicate with each other using
container names as hostnames. Containers connected to the same
bridge network can reach each other via IP addresses.

docker network create my-bridge-network


docker run --network=my-bridge-network my-
container

None Network: The none network mode disables networking for a


container. Containers running in this mode have no network interfaces
and are completely isolated from the network. This mode can be useful
when you want to run a container in a fully isolated environment.

docker run --network=none my-container

Train With
Shubham
Thank You Dosto

Train With
Shubham

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy