Docker's CentOS image has been streamlined and removed the ping and telnet commands, so it cannot be directly applied, and the command will be reported as not existing. Then, how to install this command in the docker container?
The installation command of ping:
apt-get install -y inetutils-ping
There is a high probability that the following error message will appear:
Next operation:
apt-get update
The purpose of this command is to synchronize the indexes of sources listed in /etc/apt/sources.list and /etc/apt/sources.list.d so that the latest packages can be obtained.
After the update is complete, type the command: apt-get install iputils-ping
To install the telnet command, you only need to replace the above pig with telnet operation.