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
Table of contents Preface The role of key The rol...
To beautify the table, you can set different bord...
Permission denied: The reason for this is: there ...
Docker container connection 1. Network port mappi...
Table of contents background Compile glibc 2.14 M...
Table of contents 1. substring() 2. substr() 3.in...
In languages, macros are often used to implement ...
Table of contents 1. Download nodejs 2. Double-cl...
Preface I recently installed MySQL 5.7 and found ...
Preface If CSS is the basic skill of front-end de...
MySQL has the following logs: Error log: -log-err...
Table of contents Introduction Mirror repository ...
Methods for changing passwords before MySQL 5.7: ...
I used vue and bootstrap to make a relatively sim...
<style type="text/css"> Copy code ...