microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.28k stars 814 forks source link

Docker container not able to communicate with other service running on localhost #9694

Closed alia5gar closed 1 year ago

alia5gar commented 1 year ago

Version

Microsoft Windows [Version 10.0.19044.2604]

WSL Version

Kernel Version

5.15.79

Distro Version

Ubuntu 20.04

Other Software

Docker version 23.0.1, build a5ee5b1 (Running in WSL) Docker engine is installed inside of WSL

Repro Steps

  1. Install docker engine in WSL
  2. Start a docker container also specify the container port and the host port in the run command (I have a mockserver/mockserver image running in the container)
  3. Start another service in WSL (In my case a python unicorn server)

Expected Behavior

Docker container should be able to reach the service running on localhost

We get the expected result when --net=host is passed in the docker run command

Actual Behavior

Calling the service running locally from the docker container, give connection refuse error

Diagnostic Logs

No response

ghost commented 1 year ago

What wsl --version are you running?

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!