docker-wsl-proxy allows connecting from Windows to Docker running in WSL2.
There are several important aspects of this task:
-
Tunnelling Docker API calls into WSL2
-
Conversion of Windows paths to their WSL equivalents
-
Install
socat
in WSL2 -
Run
dockerd
inside WSL2 -
Run
docker-wsl-proxy.exe -c wsl://<wsl distribution name>/var/run/docker.sock
-
Run Docker commands on Windows host
-
Clone docker-wsl-proxy Git repository
-
Run
go build
in repository root -
Now you have ready-to-use
docker-wsl-proxy.exe
You can also use go run docker-wsl-proxy.go
to build & run in one step.