Docker container installation ping and telnet commands

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:
insert image description here
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.

Guess you like

Origin blog.csdn.net/m0_37899908/article/details/130978522