我提取了Apache httpd image并运行了一个容器。然而,一旦我在一个容器中,ping就不起作用了,我看到一个错误:"bash: ping: command not found“。甚至无法ping通127.0.0.1。Ping在容器外部工作。
cat /etc/resolv.conf在容器内部和外部显示相同的名称服务器。我重新启动了Docker服务,但它也不能解决问题。
docker pull httpd
docker run -d --name testweb httpd
docker exec -it testweb /bin/bash
ping google.com
root@fb1ce4bccc11:/usr/local/apache2# ping google.com
bash: ping: command not found我试着安装Ping,但是包管理器找不到它:
root@fb1ce4bccc11:/usr/local/apache2# yum -y install iputils-20160308-10.el7.x86_64
bash: yum: command not found发布于 2019-05-20 03:33:02
我找到了一个类似的帖子:Docker - Ubuntu - bash: ping: command not found
我的第一选择是运行:
apt-get update
apt-get install iputils-pinghttps://stackoverflow.com/questions/56211124
复制相似问题