Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ip command is missing from ubuntu docker image

Tags:

docker

ubuntu

when i'm trying to perform ip command in ubuntu docker container, i'm getting:

bash: ip: command not found.

ubuntu version:

DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS" 

what package should i install for that command?

Thanks

like image 719
Gil Kahan Avatar asked Aug 14 '18 06:08

Gil Kahan


People also ask

How do I find my Ubuntu container IP address?

You can easily get the IP address of any container if you have the name or ID of the container. You can get the container names using the "Docker ps -a" command. This will list all the existing containers.

What is IP command Ubuntu?

The IP command in Ubuntu is a well-known command for network handling. Starting from the introduction of IP to the detailed use of this command in Ubuntu, it can be used to perform several network-related tasks such as monitoring the network devices, adding/removing the IP address of interfaces.

How do I install ping on Ubuntu?

To install ping command on your system, first of all, update system repositories using this command “$ sudo apt update && sudo apt upgrade”, then install the “iputils-ping” package that comprises the ping command with the “$ sudo apt install iputils-ping” command.


Video Answer


1 Answers

You could use apt-file search to determine the command in which package. From my ubuntu16.04, it tells me to install iproute2, I think 1804 similar.

1. Get what package need to be installed:

$ apt-file search --regexp 'bin/ip$' iproute2: /bin/ip iproute2: /sbin/ip 

2. Install the package:

$ apt install -y iproute2 ... 

3. Verify the package is installed:

$ dpkg -l iproute2 ii  iproute2    4.3.0-1ubuntu3      amd64      networking and traffic control tools 
like image 98
atline Avatar answered Sep 21 '22 10:09

atline