You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I extensively use windows-based docker containers, and had some specific use case where i wanted to start a linux container (in WSL), and then connect it to a windows based container.
After some wrangling, i discovered this:
# Get WSL network$network=Get-HNSNetwork|Where-Object { $_.Name-eq'WSL' }
$id=$network.Id
docker network create --driver=nat --opt 'com.docker.network.windowshim.networkname=WSL'--opt "com.docker.network.windowsshim.hnsid=$id" WSL
# Your windows containers will then have direct access to WSL. Get the IP of your WSL distro of choice:$wslIp= wsl -d MyDistro hostname -I
docker run -it --net=WSL --rm mcr.microsoft.com/windows/servercore:ltsc2022 curl $wslIp
Now, my main question here is that is this really allowed? Or highly not recommended. this works perfect for my use case, but slightly wary..
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I extensively use windows-based docker containers, and had some specific use case where i wanted to start a linux container (in WSL), and then connect it to a windows based container.
After some wrangling, i discovered this:
Now, my main question here is that is this really allowed? Or highly not recommended. this works perfect for my use case, but slightly wary..
Beta Was this translation helpful? Give feedback.
All reactions