Docker custom network1. Introduction to custom network1. Introduction When starting a regular docker container, you can use --link to bind the container network, but it will be very troublesome once there are more containers. So to customize a docker network, Xiaobai recommends using the --link command. Custom network fixes the problem that docker0 containers cannot ping each other using container names. They can only ping each other using IP. However, our custom network can ping each other using IP or container name. 2. Command
2. Create a custom network1. Start the regular container and check whether the container can be pinged It is found that it is not pingable. Next, we try it with --link It is found that the container can be pinged after using --link. --link is recommended for novices. Next, let's try it with a custom network. 2. Create a custom network docker network ls View the network list There are many types of docker networks bridge mode host is consistent with the host network none Empty network Do not use the network docker network inspect View network details docker network create Create a custom network –driver Set the network type –subnet Set custom ip routing network group –gateway Set the default ip route for this network Here I started two containers and specified the container network with –net. You can see that you can directly ping the containers in the same network. It’s very simple. This is the end of this article about the detailed introduction of Docker custom network. For more relevant Docker custom network content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Solution for using Baidu share on Https page
Alphabetical DTD: Indicates in which XHTML 1.0 DT...
Table of contents 1. Environmental Preparation 1....
If you have installed the Win10 system and want t...
In the project (nodejs), multiple data need to be...
1|0MySQL (MariaDB) 1|11. Description MariaDB data...
My97DatePicker is a very flexible and easy-to-use...
What is Docker-Compose The Compose project origin...
A website uses a lot of HTML5 and CSS3, hoping th...
Students who use Ansible know that Ansible only s...
This article example shares the specific code of ...
The following attributes are not very compatible w...
This case is based on CentOS 7 system Suitable fo...
In Docker Start all container commands docker sta...
Table of contents The difference between hash and...
In MySQL, you can specify multiple indexes for a ...