View the IP address of the Container
View the mapped port of the Container docker port <container name or id> eg. docker port d8dac7399647 docker port hfq-jedi-zxf-eden Use iptables to view container mapping
Example of adding a new port mapping
Save iptables rules
illustrate
After the port mapping is completed, the result cannot be queried through docker port d8dac7399647 Can be
Query mapping relationship Additional knowledge: Mechanisms in Docker container communication and port exposure issues The link method has always been used for communication between Docker containers. This limits the order in which each container is started, which always feels inflexible. Therefore, this time we explored accessing containers directly through the LAN allocated by the Docker's own network card. Docker port exposure means forwarding the port service of the container itself to the exposed port through the forwarding of the docker0 network card, for example, executing:
When accessing using the 172.17.0.x local area network assigned by the docker0 network card, use port 12345. When using 192.168.1.x or other local public IP to access, you need to use 8080 to access Time is limited, so I won't analyze it in detail for now. I'll analyze it with pictures when I have time. The above article about Docker dynamically exposing ports to containers is all I have to share with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed explanation of Vue mixin usage and option merging
>>: Change the MySQL database engine to InnoDB
Let's take a look at zabbix monitoring sqlser...
In this article, we will need to learn how to vie...
Table of contents 1. Basic use of css(): 1.1 Get ...
The SSH mentioned here is called Security Shell. ...
In the Linux environment, you want to check wheth...
Text shadow text-shadow property effects: 1. Lowe...
Achieve resultsImplementation Code html <base ...
Table of contents Union query 1. Query the ID and...
Due to your company standards, you may only allow...
Table of contents 1. Common mistakes made by begi...
Recently, when I was working on a front-end vue.j...
Many friends found that the box model is a square...
Table of contents Foreign Key How to determine ta...
Table of contents 1. forEach() 2. arr.filter() 3....
Two major categories of indexes Storage engine us...