Sign inSign up

devopsifyme/wslpipeproxy

By devopsifyme

•Updated almost 4 years ago

Tool for exposing unix sockets inside of WSL to Windows applications running on Windows.

Image
0

451

devopsifyme/wslpipeproxy repository overview

⁠DevOpsify Me - WSL Pipe Proxy

Tool for exposing unix sockets inside of WSL to Windows applications. One popular use case is exposing docker.sock from WSL to docker cli running on Windows.

Container can only run inside of WSL instance (doesn't make sense anywhere else), and has to have priviledged and pid=host set, so that it can install and control Windows process required for host<>host communication.

More information on Blog⁠ and Github⁠.

⁠Running

  1. Prepare WSL machine
sudo groupadd docker
sudo gpasswd -a $USER docker

sudo snap install docker
sudo apt install socat
  1. Docker Run
  • Note that the /app mount HAS to point at the parent folder of HOST_PATH!
docker run --name wslpipeproxy --privileged --pid=host -d --restart=always -v /mnt/c/:/app devopsifyme/wslpipeproxy
  1. Register context on Windows
  • Download and install Docker CLI
  • Register and set context - see container logs for exact values
docker context create docker-on-ubuntu2204 --docker host=npipe:////./pipe/dockerOnUbuntu2204
docker context use docker-on-ubuntu2204

⁠Environmental Variables

  • HOST_PATH - default '/mnt/c/wsipipeproxy'. This is the directory where tool will be installed on Windows. Current user has write access.
  • F_DISTRIBUTION - default 'Ubuntu-22.04'. Name of the target WSL distribution where docker is installed. Find with wsl --list
  • F_NPIPE - default 'dockerOnWSLUbuntu2204'. Name of the named pipe exposed on Windows for Docker CLI and compatible tools
  • F_UNIX - default '/var/docker.sock'. Docker unix socket to expose.

Tag summary

Content type

Image

Digest

sha256:bb2aa3288…

Size

92.7 MB

Last updated

almost 4 years ago

docker pull devopsifyme/wslpipeproxy