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
Table of contents 1 Test Cases 2 JS array dedupli...
About CSS3 variables When declaring a variable, a...
Web design is an emerging marginal industry that c...
Table of contents 1. Timer monitoring 2. Event mo...
Because the data binding mechanism of Vue and oth...
Table of contents Environmental conditions Errors...
Table of contents 1. Introduction: 2. Prototype c...
When using Docker containers, it is more convenie...
Table of contents vite Build Configuration vite.c...
First download VMware Workstation 15.1 version. I...
Today I found that WordPress could not connect to...
1. First, you need to use the target selector of ...
Solution function mergeImgs(list) { const imgDom ...
1.MySQL UPDATE JOIN syntax In MySQL, you can use ...
1. Environment and preparation 1. Ubuntu 14.04 2....