docker下centos安装ping命令

https://blog.csdn.net/king_gun/article/details/78423115

【问题】

从docker hub上拉取到则镜像centos:6.7在执行ping命令是报错:

  1. [root@dcd9947346b3 /]# ping
  2. bash: ping: command not found


百度上搜索,查到linux下安装ping命令的方法为:

apt-get install inetutils-ping
但是docker镜像中不存在apt-get指令,使用yum install inetutils-ping找不到对应的包 【解决】

yum 安装ping命令如下:

yum install -y iputils

原文地址:https://www.cnblogs.com/jing1617/p/9577429.html