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.
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.
I came here because I was trying to use ifconfig on the container to find its IPAaddress and there was no ifconfig. If you really need ifconfig on the container go with @vishnu-narayanan answer above, however you may be able to get the information you need by using docker inspect on the host:
docker inspect <containerid>
There is lots of good stuff in the output including IPAddress of container:
If Ubuntu Docker image isn't recognizing 'ifconfig' inside of GNS3, you'll need to open Ubuntu docker image on your host.
Assuming you already have docker on your host pc and ubuntu pull'd from docker images. Enter these commands in your host OS (Linux, CentOS, etc.) CLI.
(side note: you can add whatever other tools and services that you would like to add now, but for now this is just to get ifconfig to work.)
Now you will commit these changes to Docker. This link for committing changes is the best summary and works (skip to Step 4):
https://phoenixnap.com/kb/how-to-commit-changes-to-docker-image#htoc-step-3-modify-the-container
When you re-open the docker image in GNS3 you should now have the ifconfig command usable and whatever other tools or services you added to the container.
Enjoy!
Please use the below command to get the IP address of the running container.
Example-: