ifconfig:无法在RHEL7.3上的Centos 7容器中打开/ proc / net / dev

我在CentOS 7容器中运行“ifconfig”命令时出现这个错误

我得到的错误是

cannot open /proc/net/dev (Permission Denied) 

如何解决这个..? 我在每个容器中都遇到了这个问题。 我给了/ proc / net / dev的完全权限,但它不工作

不知道你的docker run ...命令行很难猜测,但也许你会想要添加--cap-add=NET_ADMIN到你的运行命令。

从这里 :

 For interacting with the network stack, instead of using --privileged they should use --cap-add=NET_ADMIN to modify the network interfaces.