【发布时间】:2015-02-17 13:33:10
【问题描述】:
我的 Dockerfile
FROM centos
RUN useradd me
CMD su -c "ping localhost" me
我的测试命令:
$ docker build -t test .
$ docker run --rm -it test
ping: icmp open socket: Operation not permitted
$ docker run --rm -it test /bin/bash
[root@153c87b53b53 /]# ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.126 ms
我的临时解决方案是https://www.centos.org/forums/viewtopic.php?t=39341
chmod 4755 /usr/bin/ping
【问题讨论】: