Open Phan-Tom416 opened 1 year ago
I've worked with @Phan-Tom416 to investigate this issue, here is what we found so far:
grpcurl -plaintext 172.17.0.3:50051 list
: Failed to dial target host "172.17.0.3:50051": context deadline exceeded
grpcurl -plaintext localhost:59667 list
: Failed to dial target host "localhost:59667": dial tcp [::1]:59667: connectex: No connection could be made because the target machine actively refused it."
grpcurl -plaintext host.docker.internal:59667 list
: Failed to dial target host "host.docker.internal:59667": dial tcp 192.168.101.23:59667: connectex: No connection could be made because the target machine actively refused it.
There seems to be an issue with the portmapping. We tried to reproduce this with nginx but couldn't:
docker run -p 80:80 nginx
-> Reachable on localhost:80But binding the hostport to 127.0.0.1 makes it unreachable. On my windows machine this works so I suspect this points already to some issue:
docker run -p 127.0.0.1:80:80 nginx
-> UnreachableTo rule out the container port <-> vm port mapping as the problem we tried running with host networking:
192.168.101.23:50051: connectex: No connection could be made because the target machine actively refused it.
Finally to show that it's not an issue with our grpc server itself, we ran grpcurl from another linked container which was successful:
There seems to be two related? issues:
More discussion/details also in diambra/arena#62
binding any port on 127.0.0.1 makes it unreachable from the windows host
I am seeing what appears to be exactly this behaviour to.
binding to 127.0.0.2
as a workaround (-p 127.0.0.2:xxx:xxx
) works (the port is reachable from windows and also not exposed on all public interfaces!)
Information Windows Version: Windows 11 22H1 (22000.1761) Docker Desktop Version: v4.18.0 WSL2 or Hyper-V backend? WSL2 (1.1.6.0)
Actual behavior
Cannot connect to a grpc service from Windows, but connecting from a different container to it works
Expected behavior
Should be able to connect to grpc service
Information
Output of
& "C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check
Steps to reproduce the behavior