Use docker for windows in WSL1 (!)
--
note: this applies only to WSL1. In WSL2 you can install docker and be happy — just use the official way of installing.
This article is obsolete and kept as a reference
The trick is to only install the cli in WSL and use the docker daemon running on the windows host (with docker desktop for windows)
Run the steps to install docker ubuntu from here https://docs.docker.com/install/linux/docker-ce/ubuntu/
until the line:
sudo apt-get install docker-ce docker-ce-cli containerd.io
You dont need docker-ce and containerd.io. Just use docker-ce-cli:
sudo apt-get install docker-ce-cli
Then tell your docker client to connect to the one from windows host
echo "export DOCKER_HOST=tcp://localhost:2375" >> ~/.bashrc && . ~/.bashrc
Expose the docker client api without tls (there is a setting in Docker Desktop to do that) Now docker ps
should already work.
Install docker-compose and go for it.