/ INFRASTRUCTURE

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

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.

/assets/images/posts/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.

xavier

Xavier Geerinck

Xavier works as a Cloud Solution Architect at Microsoft, helping its customer unlock the full potential of the cloud. Even though he is still considered a young graduate, he achieved his first success at the age 16, by creating and selling his first startup. He then took this knowledge to create and help more startups in different markets such as technology, social media, philanthropy and home care. While in the meantime gaining more enterprise insights at renowned enterprises such as Nokia, Cisco and now Microsoft.

Read More