In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to run the container in overlay, for this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.
Today you will run a busybox container and connect to ov_net1.
View the network configuration of the container:
Bbox1 has two network interfaces, eth0 and eth2. The eth0 IP is 10.0.0.2, which is connected to the overlay network ov_net1. Eth2 IP 172.17.0.2, where does the default route of the container come from eth2,eth2?
In fact, docker will create a bridge network "docker_gwbridge" to provide access to the external network for all containers connected to the overlay network.
The output from docker network inspect docker_gwbridge confirms that the IP address range of the docker_gwbridge is 172.17.0.0 docker_gwbridge 16, and the currently connected container is bbox1 (172.17.0.2).
Docker network inspect docker_gwbridge
[
.
"IPAM": {
"Driver": "default"
"Options": null
"Config": [
{
"Subnet": "172.17.0.0plus 16"
"Gateway": "172.17.0.1"
}
]
}
"Internal": false
"Attachable": false
"Containers": {
"100dd1207eb8412a81c980dcd191d00eb4377a7a175a806a26038e8c12259766": {
"Name": "gateway_100dd1207eb8"
"EndpointID": "5077a2bfef80c695661f555412c3679b1a309cbba8a2f1a3247d6b414d35b819"
"MacAddress": "02:42:ac:11:00:02"
"IPv4Address": "172.17.0.2 prime 16"
"IPv6Address":
}
}
.
And the gateway of this network is IP 172.17.0.1 of the bridge docker_gwbridge.
In this way, the container bbox1 can access the public network through docker_gwbridge.
If the public network wants to access the container, you can map it through the CVM port, for example:
Docker run-p 80:80-d-- net ov_net1-- name web1 httpd
Verify the connectivity of the external network.
This is the answer to the question about how to run the container in overlay. I hope the above content can be of some help to you. If you still have a lot of questions to solve, you can follow the industry information channel for more related knowledge.
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.