May 1, 2018 - infrastructure

Connect to your Docker Daemon through the Windows Subsystem for Linux (WSL)

Xavier Geerinck

@XavierGeerinck

Did you enjoy reading? Or do you want to stay up-to-date of new Articles?

Consider sponsoring me or providing feedback so I can continue creating high-quality articles!

Do you have Windows installed and you love using the Linux Subsystem on it? (commonly known as WSL) Well let me tell you the steps to achieve this.

Let's start by Install the docker client on your WSL, which you can do this easily through this command:

# Install Docker
curl -sSL https://get.docker.com/ | sh

Once you have the client readily available, you need to change a setting in your Docker Daemon (running on Windows!) by right clicking the Docker Whale in your taskbar and going to settings. There just check "Expose daemon on tcp://localhost:2375 without TLS" as shown in the screenshot below.

./docker-windows-expose-daemon.png

The last thing left to do now is to configure your WSL to let the Docker client connect to the correct daemon. For that, run the following command:

export DOCKER_HOST="tcp://127.0.0.1:2375"

Whereafter you will be able to run docker ps and see your containers running.

Did you enjoy reading? Or do you want to stay up-to-date of new Articles?

Consider sponsoring me or providing feedback so I can continue creating high-quality articles!

Xavier Geerinck © 2020

Twitter - LinkedIn