容器中运行ifconfig提示bash: ifconfig: command not found【笔记】

作者 : admin 本文共220个字,预计阅读时间需要1分钟 发布时间: 2024-06-4 共3人阅读

容器中运行ifconfig提示bash: ifconfig: command not found

这个问题是因为在容器中没有安装ifconfig命令。

在容器中安装ifconfig命令,可以使用以下命令:
对于基于Debian/Ubuntu的容器,使用以下命令:

apt-get update
apt-get install -y net-tools

对于基于CentOS/RHEL的容器,使用以下命令:

yum install -y net-tools

容器Ubuntu示例:
容器中运行ifconfig提示bash: ifconfig: command not found【笔记】插图

本站无任何商业行为
个人在线分享 » 容器中运行ifconfig提示bash: ifconfig: command not found【笔记】
E-->