Control windows docker with Windows 10 Ubuntu Linux subsystem

Windows 10 Linux subsystems are a very powerful feature and expand the capabilities for Windows based developers greatly, without the need to use VMs or dual booting. One of these is controlling your windows based docker host via your Linux subsystem.

Why?

Linux command line is much more powerful that windows standard cmd line, you can combine a number of tools using piping to perform complex operations all via cli. Many of the tutorials, guides and normal operating commands used by docker and other tools are written using Linux based command line.

1. Setup Linux Subsystem

First you need to have your linux subsystem all setup and running. here is a guide I previous wrote to do just that.

All commands below will be via your linux subsystem.

Windows 10 Subsystem for Linux Ubuntu

2. Updates and packages

3. Add Docker’s official GPG key

4. Add repository

5. Install docker client

6. Add docker host to bash profile

This is so that you dont have to keep telling docker client how to access the docker service.

7. Enable exposed daemon with docker

We are almost done, now we just need to go back to our windows system and enabled exposed daemon via the docker settings.

Right click the docker icon within your task area and choose settings.

The general tab should have a “Expose daemon on tcp://localhost:2375 without TLS”, enable this option.

You should now be able to control your Windows docker service via your Linux subsystem.

Note

There is a more secure way to establish a connect between your subsystem and docker client, have a look at the following guide.

[Cross Post] WSL Interoperability with Docker

Leave a Reply

2 × 4 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.