Home > Operation and Maintenance > Docker > What does network mode in docker mean?

What does network mode in docker mean?

WBOY
Release: 2022-08-17 16:25:18
Original
2938 people have browsed it

The meaning of docker network mode: 1. Bridge mode, the default network driver model, will automatically configure its own network information when the docker container is started; 2. Host mode, breaking the relationship between the Docker container and the host Network isolation between the two, directly using the network environment of the host machine; 3. Overlay mode, which can connect multiple docker daemons or meet the communication between cluster services; 4. none mode, which disables the network driver; 5. plugins mode, uses Third-party network driver plug-in.

What does network mode in docker mean?

The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.

What does the network mode in docker mean?

There are 5 common network modes in docker, which are

  • bridge : The default network driver model in Docker. If not specified when starting the container, it will default to this driver type;

  • host: Break the network isolation between the Docker container and the host, directly Using the host's network environment, this model is only applicable to Docker 17.6 and above;

  • overlay: can connect multiple docker daemons or satisfy communication between cluster services; applicable Communication between docker containers on different hosts;

  • none: The network driver is disabled and you need to manually customize the network driver configuration;

  • plugins: Use third-party network driver plug-ins;

Characteristics and application scenarios of various modes

bridge mode

To put it simply: wearing a vest, doing your own thing under the banner of the host. Docker's default mode will automatically configure its own network information when the docker container is started. All containers on the same host are on the same network and can communicate with each other. Similar to the nat mode of our vmware virtual machine. Using the host's network card for communication will cause resource consumption and low network efficiency because network conversion is involved.

host mode

To put it simply, it means occupying the magpie's nest and using the host's things to do your own things. Containers use the host's IP address to communicate.

Features: Containers and hosts share the network

container mode

Newly created containers use the created container network, similar to a LAN

Features: Shared network between containers

none mode

This mode is the purest and will not help you with any network configuration. Maximum customization.

overlay mode

Containers are no longer on the same network and can communicate with each other.

Recommended learning: "docker video tutorial"

The above is the detailed content of What does network mode in docker mean?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template