-
Notifications
You must be signed in to change notification settings - Fork 822
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
Binding docker container to 0.0.0.0 doesn't bind to IPv4 #9714
Comments
The issue started to appear about a week ago (after a Windows update?) A probably related issue (which started to appear at the same time) is that |
Upgrading to the most recent WSL version
does not solve the problem. |
Installing docker-engine instead of Docker Desktop seems to fix the issue. |
@cxn-pkovacs
and the container is accessible via |
@elsaco , thank you for this additional information! Indeed, I forgot to mention that my main use case is for apps and services started in WSL to consume services started in WSL. The issue is about "what happens" on the WSL side. In fact, the practical problem I am experiencing is a combination of this issue and another, much older: #4851. I am not a networking expert, but I suspect that |
ipv6 and ipv4 bindings are separate. (Except maybe for RFC 4291) |
@pmartincic , what do you mean in the context of this issue by this:
Is this issue closed, because the behavior ("ipv4 bindings don't work with Docker Desktop in WSL2") cannot be reproduced. Or else, is it closed, because ipv4 bindings not working with Docker Desktop in WSL2 is the expected behavior? |
Perhaps I closed this prematurely, if that's the case my apologies. I've seen a lot of issues created because people don't understand the ipv6 and ipv4 bindings to be separate unless you're using a dual stack socket. I closed this because of your comment regarding ipv6 bindings being reachable from ipv4 addresses and the bug you linked to. Are you using IPV6_V6ONLY set to 0 and binding to If you're bound to Please give me the output from |
Right now we don't support forwarding for dual-mode sockets, though I'll look into what would be needed for that. |
Thank you for taking some more time investigating this issue.
The simplest case I can provide is (as in the issue description) running this command on the guest:
As I understand
Running the following command on the guest
gives
and yes I can reach [::] from the guest
, but I cannot reach 127.0.0.1:
(which is expected if I correctly understand your comment about the separation of v4 and v6 adresses). |
Thanks @cxn-pkovacs, all that looks expected. If you see the last bind to Your original bug specified having issues with |
When you start the container with
And this is output of trying to reach the container: From WSL instance, running the docker engine:
From Windows host:
This works as intended. WSL 1.0.3 and Windows 10.0.22621.1344 was used for testing. Output of
There's no IPv6 listening port open, and it shouldn't be, based on the nginx container port mapping. |
Thanks @elsaco, on that note I'll close this out because that all looks expected and normal to me. |
Since this issue has been closed for the second time (this time without even waiting 10 hours for the input I was requested to provide) I decided not to reinstall Docker Desktop to provide the extra input and to desist from pursuing this issue. Thank you for the work done! |
Version
Microsoft Windows [Version 10.0.22000.1641]
WSL Version
Kernel Version
Distro Version
Release: 22.04
Other Software
docker
Repro Steps
Expected Behavior
The container binds to all available IPv4 (and maybe IPv6) network interface addresses:
Actual Behavior
The container binds only to all available IPv6 network interface addresses:
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: