Works with running it Windows also.
EDIT - too late ![]()
Share and learn in the Docker community.
Works with running it Windows also.
EDIT - too late ![]()
Thank you for testing then
I am still curious, so I have one more suggestions to try.
@meyay showed how you can test the ports on Windows, but we should also test it inside the WSL distro. You can use either netstat or “ss” which is “the new netstat”.
ss -ltpn | grep 8081
We should see the springboot API listening on an IP. Maybe it is listening on IPv6 only. “localhost” could still work as the browser tries to resolv it to ipv4 and then ipv6, but when I test host.docker.internal, it works on IPv4. A python command for testing the http server on IPv6:
python3 -m http.server --bind "::" 8087
If there is a way to make host.docker.internal work on ipv6, I couldn’t find it yet. Not even when I switch to “ipv6 only” mode in Docker Desktop.
I get this when running that command:
❯ ss -ltpn | grep 8081
LISTEN 0 100 *:8081 *:* users:(("java",pid=40890,fd=273))
Also by too late in my previous reply, I meant the edit you said too not test on windows was too late as I already had. I am still available to do testing ![]()
Okay, I shared the wrong command in my previous message. Please, try this one:
ss -ltpne | grep 8081
If the process is listening on ipv6 only, it should show it at the end of the line as “v6only:0”
I am posting only because for some reason @aliahmad05 was not allowed to post again here by discourse. So it turned out the Springboot API server indeed listened on ipv6 only.
The question still remains. Whether host.docker.internal should work on ipv6. I will share if I figure it out.