Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install "ifconfig" command in my ubuntu docker image? [duplicate]

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.

like image 302
Hind Forsum Avatar asked Mar 18 '17 03:03

Hind Forsum


People also ask

Why is ifconfig command not found?

If you tried to install the ifconfig utility and failed, it's because ifconfig cannot be individually installed. It is included with the net-tools package. To be able to use the ifconfig command, you have to install the net-tools package first.

What install ifconfig?

It is because ifconfig is not a package in its own. It is installed with net-tools package that has some additional networking tools.

What does ifconfig do in Ubuntu?

Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed. If no arguments are given, ifconfig displays the status of the currently active interfaces.


1 Answers

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.

like image 100
vishnu narayanan Avatar answered Sep 28 '22 07:09

vishnu narayanan