D
D
Danbka2020-12-05 00:33:33
Windows
Danbka, 2020-12-05 00:33:33

How to access WSL2 from a container?

The essence of the problem is reflected in the image, I can’t tell you better:

MnX9y.png

I tried the IP of the Windows host, WSL2, host.docker.internal and some magic IP 172.17.0.1

ifconfig inside wsl2:

5fcaaad45c6e8599869755.png

ifconfig inside the container:

5fcaaae67f097529647404.png

Any advice would be welcome.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danbka, 2020-12-09
@Danbka

For future seekers, the answer is here: https://docs.microsoft.com/en-us/windows/wsl/compa...

netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=WSL_IP

R
rPman, 2020-12-06
@rPman

Docker is a virtual machine with chips, you set up a network using docker tools (bridge is best) and use
https://linux-notes.org/rabota-s-setju-networking-... (the first result from Google may be outdated, but the main idea understand)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question