Docker - Bash: IP: command not found Docker - Bash: IP: command not found docker docker

Docker - Bash: IP: command not found


Install ip command package for Ubuntu.

apt updateapt install iproute2


I have tried hostname -I. Working fine for me.No need to install a new package.


Unfortunately, your link has been broken (or it might be inaccessible from Iran). Although there is not enough evidence of which Linux OS you are trying to use, a solution is provided as follow work under .deb (e.g. Ubuntu) and .rpm (e.g. Fedora) package managers.

At first, update the container's repository:Ubuntu:

apt-get update

CentOS:

yum update

Fedora:

dnf update

Secondly, install net-tools package.Ubuntu:

apt-get install net-tools

CentOS:

yum install net-tools

Fedora:

dnf install net-tools

Lately, ifconfig has been replaced with ip command. So make sure to check both commands, some Linux distributions have not changed the command yet.