Skip to main content

Posts

Showing posts from April, 2018

WSL: Interop state of mind

Introduction while playing with Docker and the Named Pipe trick , I wanted to give a more "*nix" feeling of Craig Wilhite volume mounting example: $ docker run -v C:/Users/crwilhit.REDMOND/tmp/ microsoft/nanoserver cmd.exe There's nothing wrong with this command, but the "scope" is WSL shell, and while using the docker nix command, the path of the volume is the windows one. There should be a better way, no? WSLENV to save the day Luckily, the WSL team did already implement a very nice feature,  WSLENV , and a linux command, wslpath  that will help translating the Windows path. Now it would be up to you to either create, in Windows, an environment variable and use it. Here is the same example, using LCOW (because why not), for mounting volumes in a "linux way": $ docker run --platform=linux -it -v $DOCKERVOL/mydir:/sharedvol ubuntu bash or use the wslpath command: $ docker run --platform=linux -it -v `wslpath -w /mnt/c/DockerVolumes/mydir

Docker + WSL: Get 2 daemon for the price of 1

Introduction almost two years ago, Docker announced the capability of switching between the Linux and Windows containers "mode" (far from the right click that we have today). At that time, I wrote a blog post on how to run both daemons at the same time ( http://darthnunix.blogspot.ch/2016/10/docker-for-windows-2-daemons-enter-in.html ) Fast forward to 2018, and while we were blogging on how to get the TLS connection from WSL docker client with  Rory McCune  ( https://raesene.github.io/blog/2018/03/29/WSL-And-Docker/ ), another blog post, by Stefan Stranger drew my attention (read: blew my mind) as I was trying to reproduce the same: how could I "bind" the docker socket in WSL with the Docker for Windows Linux mode socket ( https://blogs.technet.microsoft.com/stefan_stranger/2018/04/02/access-my-docker-for-windows-kubernetes-cluster-from-debian-wsl/ ) From 1 to 2 daemon: DemonHunter mode achieved Now that we have all the required setup resources, let's b