In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Docker Container is an open source application container engine that allows developers to package their applications and dependency packages into a portable container in a unified way, and then publish them to any server that installs the Docker engine. With the rapid development of cloud computing and the diversification of enterprise needs, Docker container technology has become one of the necessary skills for cloud computing talents. Many people want to quickly master Docker container technology, so let's explain the four network modes of Docker container.
1. Closed container closed network mode.
Communication without a network protocol stack uses none mode, and the Docker container has its own Network Namespace, but there is no network configuration for the Docker container. In other words, this Docker container has no network card, IP, routing and other information, only lo network interface. We need to add network cards, configure IP, etc., for the Docker container.
2. Bridged container bridging network mode
Separate network protocol stacks between containers when Docker starts, it automatically creates a docker0 virtual bridge on the host, which is actually a bridge of Linux, which can be understood as a software switch that forwards between the ports mounted to it. At the same time, Docker randomly assigns an address from a local unoccupied private network segment (defined in RFC1918) to the docker0 interface. When you create a Docker container, a pair of veth pair interfaces are also created. One end of this pair of interfaces is in the container, that is, the other end of the eth0; is local and mounted to the docker0 bridge, with the name beginning with veth. In this way, hosts can communicate with containers, and containers can also communicate with each other. Docker creates a virtual shared network between the host and all containers.
3. Joined container joint mount network mode
Containers can share the network protocol stack, that is, they can communicate through sockets. This mode specifies that the newly created container and an existing container share a Network Namespace, rather than with the host. Instead of creating its own Nic and configuring its own IP, the newly created container shares IP, port range, and so on with a specified container. Similarly, apart from the network, the two containers are isolated, such as file systems, process lists, and so on. The processes of the two containers can communicate through the lo network card device.
4. Opentainer container open network mode.
The Host mode of sharing the network protocol stack with the host is specified when the container starts-- network host. In this case, the container shares the Network Namespace of the host, and the port started in the container is directly the port of the host. The container does not create a network card and IP, but directly uses the host's network card and IP, but other resources in the container are isolated, such as file system, users and user groups. Use the host network directly. Also start a nginx, at this time to share the host network, according to the situation to use, so that there is no need to do port forwarding, network transmission efficiency will be higher.
The Docker process is to go to the repository and pull the image locally, and then use a command to run the image into a container. Therefore, we often refer to Docker as dock workers or dock stevedores, just like the Chinese translators and porters of Docker. The above does not involve the installation of Docker, the use of images, the operation of containers, and so on. It is hoped that readers can master this part by reading books and official documents.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.