1、ping
   
    
     1.1首先解决权限问题
    
   
    docker 中执行:
    
     apt-get update
    
    报错:
    
     E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
    
问题原因
:权限不足,请使用 root 用户
解决方案
:0 表示 root 用户
		docker exec -it id /bin/bash
					// 改为
		docker exec -u 0 -it id /bin/bash
    
     2.2 ping解决
    
   
    
     问题原因
    
    :
   
root@xxxxxxx:/# ping xx.xx.xxx.xxx
bash: ping: command not found
    
     解决方法
    
    :
   
先进入docker
docker exec -u 0 -it docker名或id /bin/bash
更新apt
apt-get update
安装插件ping
:
apt install iputils-ping
apt install net-tools
    
    
    2、ip
   
    
     问题原因
    
    :
   
root@xxxxxxx:/# ip a
bash: ip: command not found
    
     解决方法
    
    :
   
apt update && apt install -y iproute2
 
版权声明:本文为weixin_44487061原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
