As noted in other answers, Docker cannot be installed and hosted inside WSL, but can be used directly from there like any Windows executable.
It may take only an extra effort to make it usable without these nasty .exe extensions: Windows Bash is an alias for executable files . A related workaround provides a ready-made user script to easily create a symbolic link. Symlinks can be freely used inside non-interactive shell scripts, unlike bash aliases.
There is also an approach with connecting from WSL to Docker for Windows as a remote host, described at https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly .
If you are interested in βwhy not just launch docker.exe and docker-compose.exe from Docker for Windows directly into WSL?β, Then this is due to an error when interactively launching Docker or Docker Compose in this environment. TL DR - you cannot run anything in the foreground interactively, which makes it unsuitable for real web development.
But, unfortunately, there is no reference to the exact symptoms of the error. And I have not encountered this so far.
source share