The networking in Docker They are a tool that is responsible for define how containers will communicate of the platform with each other. The Docker container system has different types of networks that are used to fulfill a wide variety of tasks and objectives and that, in addition, have the possibility of interconnecting using the so-called network driversamong those that stand out bridge, host and none.
Network drivers in Docker
The subsystem in charge of managing networks in Docker It is characterized by its property of being connectable, as well as for its use of drivers. Some of these are pre-assigned by the system and offer a range of basic network functionality.
Among the most relevant drivers and network types in Docker are:
Bridge is the standard network and network drivers default, so it is created once the Docker platform is started and its containers are connected to it, unless the user specifically indicates otherwise. Usually used when client applications run in separate containers each other, but they require communication.
This type of network applies to those containers that run on the same host docker daemon. It should be noted that each of these containers has its own network, which is also independent of the network of the host where they are located.
The networking driver in Docker called Host is he responsible for eliminating the isolation that may exist between a container of the platform and host. So, when the network is in mode host, can be used to improve performance. At the same time, this docker networking driver works in times where a container requires controlling a great diversity of ports, because it does not need to perform the network address translation process and, furthermore, a proxy username for each of the ports.
In this type of Docker networks, the container will use the same IP address of the real server that the user has.
This type of docker networking driver can only be used in hosts native to the Linux operating system and does not have support for resources such as Docker Desktop MAC version or Windows, nor is it compatible with Docker EE for Windows operating system servers.
It refers to one of the types of networks in Docker that fulfills the function of create a distributed network between different hosts of the daemon from Docker. This allows the connection of various containers on different nodes of the system.
These docker networks connect several of the daemon from Docker, which contributes to the communication of the so-called swarm services either swarm services between each other and with an independent type container, or between two independent containers that are located in different daemon of the platform. These tasks allow us to eliminate the need to perform OS-level routing between Docker containers.
Ipvlan indicates one of the networks in Docker or container network that is responsible for offer users full management and control over IPv4 and IPv6 addresses. The Ipvlan controller also provides operators with all the handling of layer 2 VLAN type tagging, and even elements such as IPvlan L3 routing for those users who want to perform underlying network integration processes.
This is one of the networks in Docker that used to assign a MAC address to a given container, making it appear as if it were a physical device on your network. So the daemon Docker is responsible for routing traffic to the containers through their MAC addresses.
This networking driver in Docker It is very useful for managing applications that have been inherited and that expect to connect directly to the physical network, rather than being routed through the network stack of the host of the platform.
This container network option is responsible for disable all networks of the container platform. It is usually used in conjunction with a user-customized network driver.
Commands for networking in Docker
Some of the commands that can be used to create docker network and manage docker networks.
Docker network create: is responsible for creating a new network in the system.
Docker network ls: offers a list of the networks that the user has.
Docker network rm: allows you to delete one or more networks.
Docker network connect: is the command that allows the process of connecting a container to a network.
Docker network disconnect: performs the function of disconnecting a container from the network.
Docker network inspection– This option is used to obtain detailed information about a specific network.
What is the next step?
Thanks to this article you have been able to learn what networks are in Docker, as well as what their characteristics, types and main functions are within the system. Now is the time to move forward and continue learning through our DevOps & Cloud Computing Full Stack Bootcamp, such as creating a docker network. In just 6 months you will master this and other tools that will allow you to gain an advantage over your competitors in the IT sector. Request information and sign up now!