In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What is the applicable scenario of none and host network? I believe many inexperienced people are at a loss about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
We will first learn about several native networks provided by Docker and how to create custom networks. Then it discusses how containers communicate with each other and how containers interact with the outside world.
Docker network can be divided into container network on a single host and network across multiple host in terms of coverage.
When Docker is installed, three networks are automatically created on host, which can be viewed with the docker network ls command.
Let's discuss them separately.
None network
Therefore, the name Siyi, none network is nothing of the network. The container hanging under this network does not have any network card except lo. When the container is created, you can specify the use of the none network with-- network=none.
We can't help but ask, what is the use of such a closed network?
Actually, there are application scenarios. Closeness means isolation, and some applications that require high security and do not need networking can use none networks.
For example, the only purpose of a container is to generate random passwords, which can be put into the none network to prevent passwords from being stolen.
Of course, most containers need a network, so let's move on to the host network.
Host network
Containers connected to the host network share the network stack of Docker host, and the network configuration of the container is exactly the same as host. You can specify the use of host networks with-- network=host.
You can see all the network cards of host in the container, and even hostname is host. What is the usage scenario of the host network?
The biggest advantage of using Docker host network directly is performance. If the container has higher requirements for network transmission efficiency, you can choose host network. Of course, the inconvenience is to sacrifice some flexibility, for example, to consider port conflicts, ports that are already in use on Docker host can no longer be used.
Another use of Docker host is to allow containers to configure host networks directly. For example, some cross-host network solutions, which themselves run as containers, require network configuration, such as managing iptables.
After reading the above, have you mastered the applicable scenarios of none and host networks? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.