Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

ip command is missing from ubuntu docker image

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

question from:https://stackoverflow.com/questions/51834978/ip-command-is-missing-from-ubuntu-docker-image

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...