You can use the ifconfig command to view the ip of the docker container:
Install the ifconfig command
The reason why "bash: ipconfig" appears : command not found" error message,
is actually because the ifconfig command is not installed on the system.
We only need to install this command, but this command cannot be installed directly.
Instead, a network tool package (net-tools) needs to be installed.
The ifconfig command is included in the "net-tools" software package.
1. yum installs the "net-tools" software package
[root@2c624c92de27 /]# yum -y install net-tools // -y 在安装过程中自动回答“yes”
2. The installation process is as follows:
Use " ifconfig" to view the IP information of the container
[root@2c624c92de27 /]# ifconfig // 本机查看网卡信息
For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.
The above is the detailed content of How to check the ip of docker container. For more information, please follow other related articles on the PHP Chinese website!