-
Notifications
You must be signed in to change notification settings - Fork 0
Docker: Docker Networks
Everything to docker networks and more. You'll find it all here.
Docker Networks what are they? Very-Simple, imagine them as a bridge between containers and the external environment. It allows traffic to travel between the containers (internal environment) to external systems (external environment). This is done by offering various networking models and configurations, Docker Networks empower developers to design flexible, scalable and secure network architecture for their containerized applications. It helps with restricting access to some container services.
Docker Networks offer versatile solutions for containerized environments, allowing seamless communication and connectivity. Let's delve into some prominent use cases where Docker Networks play a crucial role:
-
Microservices Architecture: Docker Networks enable communication between microservices in containerized applications, supporting scalability and fault isolation.
-
Multi-Tier Applications: Docker Networks facilitate the deployment of multi-tier applications by connecting frontend, backend, and database containers, ensuring secure and efficient communication.
-
Hybrid Cloud Deployments: Docker Networks allow for seamless communication between containers across on-premises and cloud environments, enabling organizations to leverage both infrastructures effectively.
Docker Networks provide indispensable capabilities for a variety of use cases, including microservices architecture, multi-tier applications, and hybrid cloud deployments. By enabling efficient communication and connectivity between containers.
If you ever created a docker network over Portainer you may have noticed that there are multiple network types you could use to configure your own customized docker network. Then you also may have realized that they aren't really types but more akin to divers for the docker network. There a five different drivers, these drivers are the following:
bridge
host
overlay
ipvlan
macvlan
none
The effects on the docker network depend on the driver used, each driver has a different effect. See below for more information:
-
bridge:
When using thebridge
driver the docker network will use the default network driver, meaning it'll have access to the internet of the hosts driver. It uses NAT for this, to create a distinct network from the host. -
host:
When using thehost
driver the docker network will remove the isolation between host and container network, meaning it will directly use the network interface. Meaning that they wont have their own dedicated network stack and ip-address'. -
overlay:
When using theoverlay
driver for the docker network the containers within the docker networks are most likely operating on docker swarm, cloud or different hosts/nodes. Theoverlay
driver allows to have interconnectivity between multiple nodes, by allowing the daemons to communicate with each other. -
ipvlan:
When using theipvlan
driver in Docker, the Docker network leverages the physical or virtual interfaces of the host directly. This unique approach offers enhanced performance compared to other network drivers, as it circumvents the overhead associated with virtual bridges. Additionally, it grants administrators full control over IPv4 and IPv6 configurations. -
macvlan:
When using themacvlan
driver in Docker, containers are indeed assigned MAC addresses that are distinct from the host's MAC address. These MAC addresses are typically associated with the containers' virtual network interfaces, which are created by the macvlan driver. -
none:
When using thenone
driver or simply said no driver it will completely isolate the docker containers contained in the docker network from the outside world (Outside world being external environment e.g. Host and other docker networks and nodes)