Docker's network template is somewhat similar to the host-only mode we usually use virtual machines. The container and the host form an independent LAN. The host's IP is 172.17.0.1, corresponding to The network name of the host is docker0.
(Related recommendations: docker tutorial)
So if you want to see the ip address of the docker container, you only need to install net- tools
yum install net-tools -y
You can check it with ifconfig after that
The above is the detailed content of How to check the IP address of a docker container. For more information, please follow other related articles on the PHP Chinese website!