如何安装"ifconfig"我的ubuntu docker映像中的命令? [英] How to install "ifconfig" command in my ubuntu docker image?

查看:123
本文介绍了如何安装"ifconfig"我的ubuntu docker映像中的命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了ubuntu docker镜像,当我执行"ifconfig"时,它说没有这样的命令,我尝试了apt-get install,因为没有名为"ifconfig"的包(我可以安装其他镜像).

那怎么做呢? 谢谢.

解决方案

在新的ubuntu docker映像上,运行

apt-get update
apt-get install net-tools

可以通过登录docker容器执行这些操作,或者将其添加到您的dockerfile中以构建具有相同图像的镜像.

I've just installed ubuntu docker image, when I execute "ifconfig" it says there's no such command, I tried apt-get install by there's no package named "ifconfig"(I can install some other images).

So how to do this? Thanks.

解决方案

On a fresh ubuntu docker image, run

apt-get update
apt-get install net-tools

These can be executed by logging into the docker container or add this to your dockerfile to build an image with the same.

这篇关于如何安装"ifconfig"我的ubuntu docker映像中的命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆