Skip to content

Instantly share code, notes, and snippets.

@smuuf
Last active May 27, 2020 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smuuf/aa6b5bcf40fe075cca4cd84dbf9477ad to your computer and use it in GitHub Desktop.
Save smuuf/aa6b5bcf40fe075cca4cd84dbf9477ad to your computer and use it in GitHub Desktop.
Docker: WSL1 client WSL2 daemon
#!/bin/bash
# Have this in your client WSL1 ".bashrc" file.
WSL_DAEMON_DIST_NAME="Alpine" # WSL distribution name which has Docker daemon running in it.
export DOCKER_HOST=`wsl.exe -d $WSL_DAEMON_DIST_NAME eval ifconfig | grep -A 1 eth0 | grep -Po "\d+\.\d+\.\d+\.\d+" | head -n1`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment