-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL: make host.docker.internal work #893
Comments
Ports are mapped to localhost. Have you tried connecting to your containers on localhost? |
|
@ppiotrow Please confirm that this is about the Windows version. I assume @mattfarina has set the |
I'm on MacOS |
Any update about how to call host (Windows) from container? If |
On macOS you can currently use We should implement |
On Windows it looks like the recommended way to determine the host IP is to extract it from
|
From Rancher Users Slack:
|
See also #1000 (comment) |
From Rancher Users Slack:
|
For WSL, it looks like (assuming it's generating |
Another way to get the IP that works for me:
Or filter further with
Or with Powershell Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias "vEthernet (WSL)" | Select-Object -ExpandProperty IPAddress |
If we only update the hosts file in the rancher-desktop distribution, then we won't need to elevate, but that means you can't connect to it from Windows / other WSL distributions. If we do update it system-wide, then we'll need administrator privileges (which probably means we want to have a Windows service that the front end can start). We can set the service permissions if necessary. However, that would mean we need to install the application as an administrator (so there will be some migration). This will probably not happen in the short term. I'll get started on the first (container-only) solution, at least. |
This also needs to be investigated for macos in a separate ticket. |
Hello, I'd posted on the separate 1490 issue, but felt it was related in that the discussed workaround for at least on Windows involved manually editing the Docker-Desktop issue 249 goes back even further (circa 2016) and discusses similar (Windows) host file edits as a workaround. In that same context, they also confirm the issue was fixed in an upcoming release of Docker-Desktop at the time. Could that same, or similar, fix be adopted in Rancher Desktop in order to make host.docker.internal work in a similar way? |
I believe we have a working solution for For the release after the next we are likely to switch to a different stub resolver, that is already used on Rancher Desktop for Linux and macOS, which will handle lookup with split-DNS configurations correctly. That one will also have support for |
Really appreciate the quick follow-up @jandubois and great to hear this will be resolved in the next release of Rancher Desktop. I'm helping test Rancher Desktop for my team and DNS issues when pulling from our group's private image repos over our VPN is the main item I'm having issues with and is keeping me coming back to Docker Desktop. Also just clarifying, but is "the current (new) approach" referring to having to edit the |
No, on Windows we will be running dnsmasq inside the distro, and the name will will be defined in the dnsmasq config file. /etc/resolv.conf inside the distro will point to this dnsmasq instance, so the name will be resolved before we ever need to query the Windows /etc/hosts. We also filter the Windows /etc/host to make sure none the |
I definitely have this resolving under a Rancher Desktop shell, and I thought it resolved under my container running under RD at one point, but it definitely isn't now... It might be that it resolved when I first ran Except, I just rebuilt an image and ran it, and the name resolved. Then I stopped and started the container, and it still resolved. So I'm not sure what's different. |
Thank you for this, I've been searching for a solution for more than a month. Finally I can talk to localhost! |
For feature requests, describe what you'd like to add or change
host.docker.internal works and behaves like in Docker Desktop
https://docs.docker.com/desktop/windows/networking/
The text was updated successfully, but these errors were encountered: