问题

测试两个docker容器之间是否ping通,提示bash: ping: command not found

在这里插入图片描述

解决

bash: ping: command not found的主要原因是,当前环境下载Centos基础镜像包含简单操作系统,相当于裸机状态,要想用别的命令需要手动安装

#执行以下命令
apt-get update
apt install iputils-ping
apt install net-tools

重新测试
在这里插入图片描述

成功!

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注