bash:/ bin/ping:rhel 7.1 docker镜像上不允许操作

deb*_*ter 1 ping docker

[root@e732ba272c77 chef-repo]# ping www.google.com
bash: /bin/ping: Operation not permitted
Run Code Online (Sandbox Code Playgroud)

尝试在/ bin/ping上给予执行权限但是没有工作

deb*_*ter 5

[root@e732ba272c77 chef-repo]# setcap cap_net_raw+ep /bin/ping 


[root@e732ba272c77 chef-repo]# ping www.google.com            
    PING www.google.com (173.194.121.50) 56(84) bytes of data.
    64 bytes from iad23s26-in-f18.1e100.net (173.194.121.50): icmp_seq=1 ttl=49 time=69.1 ms
    64 bytes from iad23s26-in-f18.1e100.net (173.194.121.50): icmp_seq=2 ttl=49 time=68.7 ms
Run Code Online (Sandbox Code Playgroud)