可以使用ifconfig命令查看docker容器的ip:
安裝ifconfig命令
之所以出現(xiàn)“bash: ipconfig: command not found”錯誤提示,
其實是系統(tǒng)沒有安裝ifconfig命令。
我們只需要安裝這個命令就可以了,但是這個命令不能夠直接安裝,
而是需要安裝一個網(wǎng)絡(luò)工具包(net-tools)。
ifconfig命令就在“net-tools”軟件包里包含著。
1、yum安裝“net-tools”軟件包
[root@2c624c92de27 /]# yum -y install net-tools // -y 在安裝過程中自動回答“yes”
2、安裝過程如下:
使用“ifconfig”查看容器的IP信息了
[root@2c624c92de27 /]# ifconfig // 本機查看網(wǎng)卡信息