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
Windows build number: [run `cmd.exe /c ver`]
**Microsoft Windows [Version 10.0.19042.804]**
Your Distribution version: [On Debian or Ubuntu run `lsb_release -r` in WSL]
**Release: 20.04**
Whether the issue is on WSL 2 and/or WSL 1: [run `cat /proc/version` in WSL]
**WSL2**
Steps to reproduce
I will apologize for asking this question in the form of a bug report but i have spent the better part of a day trying to find a solution with no luck, all the articles i have found are about running linux containers.
I am attempting to run windows based containers from wsl2, I am doing both linux and windows development but i prefer to work in WSL. I can run linux containers from windows and WSL2 but I want to test a chef cookbook on windows from WSL.
I have tried switching to windows containers and If i remove the WSL2 integration i get docker not found
if i enable the WSL2 integration i get
docker pull mcr.microsoft.com/windows/servercore:10.0.19042.867-amd64
10.0.19042.867-amd64: Pulling from windows/servercore
18ae6bebe21d: Pulling fs layer
b67d61f938f3: Pulling fs layer
image operating system "windows" cannot be used on this platform
docker does not seem available to WSL via the network i.e tcp://localhost:2375 ( i have enabled that via docker desktop).
also from test-kitchen if i try to start the windows machine i get
---- Begin output of docker -H npipe:////./pipe/docker_engine build -f Dockerfile-kitchen20210331-14863-1a6c3mm . ----
STDOUT:
STDERR: protocol not available
---- End output of docker -H npipe:////./pipe/docker_engine build -f Dockerfile-kitchen20210331-14863-1a6c3mm . ----
Ran docker -H npipe:////./pipe/docker_engine build -f Dockerfile-kitchen20210331-14863-1a6c3mm . returned 1] on default-windows
As a workaround, what if you use docker.exe instead?
It won't work to access the docker socket at "tcp://localhost" because the WSL2 environment has a different IP address than Windows. You can get the IP of the Windows host using a method like this: #4619 (comment) That might allow you to access the docker socket over the network like that.
I added a firewall rule for 2375, all nets, all interfaces, on windows I can connect to localhost:2375 but not the wsl ip because it is only being shared on localhost
I haven't reproduced, but this is in all likelihood #5211. Docker is a TCP service running on the Windows side in this scenario. If you are unblocked, please close and subscribe #5211. There is also docker forum discussion here.
Activity
shawnz commentedon Mar 31, 2021
As a workaround, what if you use
docker.exeinstead?It won't work to access the docker socket at "tcp://localhost" because the WSL2 environment has a different IP address than Windows. You can get the IP of the Windows host using a method like this: #4619 (comment) That might allow you to access the docker socket over the network like that.
rreilly-edr commentedon Mar 31, 2021
I have tried using the ip of windows and 2375 is not available
shawnz commentedon Mar 31, 2021
Is the problem perhaps that its being firewalled?
rreilly-edr commentedon Mar 31, 2021
I added a firewall rule for 2375, all nets, all interfaces, on windows I can connect to localhost:2375 but not the wsl ip because it is only being shared on localhost
rreilly-edr commentedon Mar 31, 2021
adding this port forward
allows me to switch to windows containers and start them from WSL2 when specifying the -H tcp://172.25.208.1:2375
therealkenc commentedon Mar 31, 2021
I haven't reproduced, but this is in all likelihood #5211. Docker is a TCP service running on the Windows side in this scenario. If you are unblocked, please close and subscribe #5211. There is also docker forum discussion here.