1

I am using Rancher Desktop with dockerd(moby)

When I use docker desktop, I can connect to the host machine from the container using host.docker.internal

But while using Rancher Desktop, host.docker.internal is not pointing to the localhost(I'm trying to connect to postgres database on my localhost). I have also tried --network=host but I'm not able to curl to http://127.0.0.1:8080, provided I had a frontend running on 8080.

What should be the alternative host.docker.internal for Rancher Desktop with dockerd(moby) ?

I have tried quite a few answers but none has helped me. I know this question has been asked but any help would be really appreciative.

Kaneki21
  • 1,323
  • 2
  • 4
  • 22

1 Answers1

0

On Windows, you may need to create a firewall rule to allow communication between the host and the container. You can run below command in a privileged powershell to create the firewall rule.

New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action All

Pls refer here

https://docs.rancherdesktop.io/faq/#q-can-containers-reach-back-to-host-services-via-hostdockerinternal

Prithivi
  • 1
  • 2