- Download and install Docker CE from the official website 🗗.
- Open settings and;
- Share any drives that will be used to mount from.
- Expose the daemon without TLS (if you understand the risks).
- Exposing the daemon without TLS is an easy way to open it up for bash in WSL.
- Turn off experimental features until you need them
- Experimental features produced problems with containers filesystems for me before.
Prevent troubleshooting as per MS WSL #2288 🗗:
$ sudo rm /var/lib/dpkg/info/docker.prerm
$ sudo rm /var/lib/dpkg/info/docker.io.prerm
$ sudo rm /var/lib/dpkg/info/docker-ce.prerm
It's fine if it says the file or directory doesn't exist.
Now remove any existing packages:
$ sudo apt-get remove docker-compose docker-ce docker docker-engine docker.io
Install packages to allow apt to use a repository over HTTPS
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
Add Docker's official GPG key
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Set up the repository
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Update source lists
$ sudo apt-get update
Install Docker
$ sudo apt-get install docker-ce
Or otherwise official documentation 🗗 or this blogpost from Tomas Lycken 🗗.
Check if host OS Docker daemon can be reached:
$ docker -H tcp://0.0.0.0:2375 images
If so, set it as an environment variable:
$ export DOCKER_HOST=tcp://0.0.0.0:2375
Check if it worked:
$ docker images
If so, add it to our bashrc, to persist the change
$ echo "export DOCKER_HOST='tcp://0.0.0.0:2375'" >> ~/.bashrc
In case this method does not work anymore, have a look at this blogpost from Tomas Lycken 🗗 and check for any updates.
See below or read the Compose official documentation 🗗.
Docker CE for Windows already includes Compose.
Install using Pythons package manager
$ sudo pip install docker-compose
verify by running
$ docker-compose
See below or read the Kompose official documentation 🗗.
$ curl -L https://github.com/kubernetes/kompose/releases/download/v1.12.0/kompose-linux-amd64 -o kompose
$ chmod +x kompose
$ sudo mv ./kompose /usr/local/bin/kompose
$ curl -L https://github.com/kubernetes/kompose/releases/download/v1.12.0/kompose-darwin-amd64 -o kompose
$ chmod +x kompose
$ sudo mv ./kompose /usr/local/bin/kompose
\> go get -u github.com/kubernetes/kompose