36

How can I install the package for "networks" on a very think ubuntu image in docker?

I need to add this package in an image using a Dockerfile

2 Answers 2

48

I found the answer here:
https://stackoverflow.com/questions/51834978/ip-command-is-missing-from-ubuntu-docker-image

# apt update
# apt install iproute2 -y

My docker container although didn't have iproute2 package installed, the internet connection was active.

1
14

ip program is a part of iproute2 package

user@ubuntu18:~$ dpkg -S ip | grep '/sbin/ip$'
user@ubuntu18:~$ iproute2: /sbin/ip
4
  • 3
    Too long and complicated, use dpkg -S $(which ip) instead.
    – N0rbert
    Feb 23, 2020 at 20:19
  • how can I install the package, downloading it manually and copying it into the container?
    – danilo
    Feb 24, 2020 at 17:02
  • @N0rbert Thanks, but I get dpkg-query: no path found matching pattern /usr/sbin/ip; I think that this is because the thing is a link to /bin/ip Oct 26, 2022 at 10:07
  • And readlink -f doesn't work either as it seems that /bin gets translated to /usr/bin which isn't in the package :( Oct 26, 2022 at 10:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .