Docker Powershell WSL

Feb 1, 2025

Recently I had to return to working on Windows and didn’t want to install any docker desktop client as I didn’t need it and I wanted to share my docker socket from WSL with Powershell instead of having it installed on Windows and WSL.

Here is how I achieved it:

{
  "hosts": ["unix:///var/run/docker.sock", "tcp://localhost:2375"]
}

Now from within Powershell your docker will connect to the instance running in WSL.

If you also want it to autostart on boot, there’s a few more steps.

Set ws \= CreateObject("Wscript.Shell")
ws.run "wsl", vbhide