Skip to content

Instantly share code, notes, and snippets.

@smuuf
Created February 23, 2025 16:47
WSL1 docker client with WSL2 docker daemon

WSL1 docker client with WSL2 docker daemon

  1. Install Docker engine in both WSL1 and WSL2.
  2. In WSL1: Create, configure and use new context:
    $ docker context create wsl2daemon
    $ docker context update --docker "host=tcp://[::]:2375" wsl2daemon
    $ docker context use wsl2daemon
    
  3. In WSL2: Configure the daemon in /etc/docker/daemon.json:
    {
      "hosts": ["tcp://[::]:2375"]
    }
    
  4. Start (or restart) Docker daemon in WSL2.
  5. Run docker info in WSL1 (you might need to wait a bit for daemon in WSL2 to fully initialize).
  6. Profit 💸
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment