Ping from within a container does not actually ping

Expected behavior

When performing a ping on my host machine to Google’s DNS server 8.8.8.8, I get 30-60ms. From within a container pinging 8.8.8.8, I expect the same or slower ping responses.

From within the container, when I ping 8.8.8.9, an IP address that does not exist, the ping should report 100% packet loss.

docker run --rm -it alpine ping -c 1 8.8.8.8
docker run --rm -it alpine ping -c 1 8.8.8.9

Actual behavior

Pings to both 8.8.8.8 and 8.8.8.9 from within the container respond with lightning fast response times (under 1ms).

Information

Host: OS X El Capitan (10.11.4)
Docker: 1.11.1-beta10 (build 6662)
Network: wifi
Container Images tested:

  • alpine
  • phusion/baseimage
2 Likes

Thanks for the report… we were waiting for someone to notice this :stuck_out_tongue:
It’s being tracked on issue (#1925) on our tracker and we have a fix in the pipeline.
I’m hoping it will be available in the next 2-3 weeks!
Keep the feedback coming, and thanks for trying Docker for Mac!

any update to this?
running 1.12.0-rc4-beta20 – and the error still persists as of 7/27.
this is particularly an issue as i’m using a toolset that depends on certain pings failing, which never happen.

Same behaviour here, with the final release of Docker for Mac. I can’t use Docker for Mac with tools that rely on ping to detect presence of devices on my network.

There’s an issue open for this problem on the public tracker:

I can see the same behaviour with Docker for Windows. When the fix comes is it going to be only for Docker for Mac? (since the github path would suggest that).

We plan to fix the issue on both Mac and Windows, but the fixes may land at different times.

+1 - because it looks like I have to +1 to get feedback on updates?

+1 too really need this update

What’s the status on this? I’m still seeing this issue today in an alpine-based container.

I have the same issue. Inside a container it doesnt matter which IP i am pinging it does get responses.

I am using Version 17.03.1-ce-mac5 (16048)

Is there any update on this?

This issue has been open way to long and is disrupting lots of development efforts. Can we get an ETA on resolution?

still reproducible. Can we please get this fixed?