Is Docker running within WSL or connecting back to Windows?
The Docker daemon can't run under WSL as it doesn't implement the necessary kernel ABI's. If you're running Docker for Windows, you are probably connecting to the Hyper-V virtual machine that it manages.
Because it's on a different machine, you will not be able to mount WSL directories as Docker volumes, but you can build images from a WSL directory. This is because on a build, the client creates a tarball and sends it to the daemon.
This is a workaround which is to use Docker on windows in WSL instead.
Just add the following to your WSL .bashrc
file.
export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
export PATH="$PATH:/mnt/c/Program\ Files/Docker/Docker/resources/bin"
alias docker=docker.exe
alias docker-compose=docker-compose.exe
Reference: https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/