Skip to content
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

WSL2: Access from Windows to container IPs #5113

Open
paolomainardi opened this issue Apr 20, 2020 · 3 comments
Open

WSL2: Access from Windows to container IPs #5113

paolomainardi opened this issue Apr 20, 2020 · 3 comments
Labels

Comments

@paolomainardi
Copy link

Is your feature request related to a problem? Please describe.

As we have a development workflow based on DNS, to achieve this we need the access to containers ips from the dev machies. It is quite straightforward on Linux, on OSX we just need to set a custom route 172.16.0.0/24 to the docker-machine.

How can we achieve this on WSL2 ? Is there something already supported ?

Thanks!

@ad-on-is
Copy link

ad-on-is commented Apr 20, 2020

I have a similar setup, and it unfortunatelly does not work out of the box with WSL2 since it's IP address changes every time you restart.

But, it works with Docker running inside WSL2. So, if you can set up your development workflow to use Docker instead it works fine.

I have nginx running with Docker on WSL2 and dnsmasq pointing all *.user.local wildcard-domains to 192.168.1.100 which is assigned to my Windows machine. This allows me to access my services from any device within my LAN.

@simonmatt
Copy link

Please try these solutions that could help you guys:

@paolomainardi
Copy link
Author

Thanks @simonmatt but i cannot still find a way there on how to access containers from windows, using their internal ips.

I can do it quite easily on OSX + Virtualbox just by adding a static route to 172.17.0.0 to the virtuabox vm.

I don’t know the internals of hyperV and Windows to understand if this is technically doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants