docker-mac-net-connect icon indicating copy to clipboard operation
docker-mac-net-connect copied to clipboard

chore: support connecting to docker desktop containers on windows

Open bliles opened this issue 1 year ago • 2 comments

It's possible that a change like this would be better off as a fork or even a separate repo, which I'm willing to do, but I wanted to see first if you would be interested in upstreaming the work. It could mean that the project would become something like Docker Desktop Net Connect.

I've tested the Windows support and the biggest limitation is that the user needs to start the executable as a privileged service (I've just been using psexec for testing). Simply launching the executable from an elevated shell is insufficient for starting the tunnel.

bliles avatar Aug 15 '24 17:08 bliles

Hey @bliles, great work! Definitely open to upstreaming this 🚀

Edit: looks like the Docker Windows docs have been updated to be more clear - direct IP addressing is only available on Windows containers. So definitely will need WireGuard here!

Give me a bit of time to review this PR 👍


Original:

Just so that I'm clear, can you confirm that Windows does not expose any kind of bridge network already for containers? We've briefly looked at supporting Windows in the past but decided against it at the time because the Docker docs seemed to mention a bridge network already existing: #9

Tbh, even if a bridge network does already exist on Windows, we still need to update the routing table so worth adding that at a minimum (or the full WireGuard tunnel to be consistent)

gregnr avatar Aug 15 '24 19:08 gregnr

Thanks so much for taking a look at my work, feedback appreciated!

Windows does have a bridge network for the containers, but this network is limited to the docker VM: https://docs.docker.com/desktop/networking/#i-cannot-ping-my-containers. The docs further state that the bridge network is not reachable from the host (unless you are using Windows containers).

The solution generally mentioned for Docker on Windows is the same as Mac, mapping ports from the host to the container.

bliles avatar Aug 15 '24 19:08 bliles