dimanche 19 juin 2016

Docker CLI on WSL for Docker beta on Win10

Introduction

For this second post, I will continue the work of getting WSL to feel even more "home".
As stated before, I have "crazy" ideas and 2 of them are:
  1. Get a "Docker Ocean" where both MSWhales and NixWhales can swim freely ;) -> simply means that I could pull both kernels images and run them on Win10 (if possible), while choosing the Linux Docker CLI instead of Powershell. Yes, just because I can (and because that's this blog topic).
  2. I have the chance to have a Pluralsight account (thanks Boss) and I would like to edit files with the great VSCode, while running the backend services on WSL. My current test is Angular2 (but more to come eventually on a future blog post).

Goal of this blog post

Nothing fancy here, just want to show (if you don't know it by know) how easy it is to interact between WSL and the Win10 "hosting" it.
Also, I'm trying to put all the building blocks together in order to achieve my crazy idea 1.

Prerequisites

Based on the Goal described above, there's only 2 mandatory prerequisites and 1 optional:

Docker installation on WSL

Be ready as this one will be the most difficult task of this blog post:
 $ curl -sSL https://get.docker.com/ | sudo sh 

Ok, it will indeed "install" Docker, however the Daemon will fail to start:

Still, the Docker CLI is installed and working fine. And, as expected, only  $ docker version  is returning a result:

Just for a comparison, here is the result of  > docker version  from Powershell:

Make it work all together

Before you can finally start playing with Docker, there's one last important setting to configure in order to be able to communicate with the running Docker Beta daemon:
 $ export DOCKER_HOST=tcp://:2375 

And now you can choose either Powershell or "Bash on Ubuntu on Windows" (yes, doing it on purpose until a better name comes :) to manage Docker containers on Win10:

Final thoughts

The more I "play" with Win10 and WSL, the more it confirms my impression: Win10 is all about possibilities and choices.
The "how can I" replaced the "why can't I" ... 

Big props again to all the persons involved in or outside Microsoft.

Darth Nunix


Aucun commentaire:

Enregistrer un commentaire