2015-10-13 61 views

回答

5
[[email protected] chef-repo]# setcap cap_net_raw+ep /bin/ping 


[[email protected] 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 
+0

謝謝,它也幫助我正式發佈了fedora鏡像 – vodolaz095

0

你應該開始CAP_NET_ADMIN特權泊塢窗容器ping命令需要這個。

docker run --cap-add net_raw --cap-add net_admin <other options> <container name> 

您可以參考此鏈接的詳細信息,這一點:How to enable ping in RHEL 7.1