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

Hind Forsum picture Hind Forsum · Mar 18, 2017 · Viewed 122.5k times · Source

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.

Answer

vishnu narayanan picture vishnu narayanan · Mar 18, 2017

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.