4

Practically I want to play with .NET Core within Docker.

So as I understand it from this post to give myself the best flexibility I would install "Docker For Windows". Means I can ultimately deploy my .Core app to a container that is either a Windows or a Linux container. However the Linux container is still a Hyper-V managed Linux container.

1) Is there a way to instead use the Windows Subsystem for Linux (WSL) to do this in the Windows 10 Creators Update? Seems like less overhead than have Windows/Docker manage a separate Linux VM for me?

Community
  • 1
  • 1
TheEdge
  • 9,291
  • 15
  • 67
  • 135

1 Answers1

1

No, running Docker containers in WSL is not supported (link mine):

The docker engine is not a supported scenario in the short term. I would suggest hitting our User Voice page and upvoting Docker if you're looking to run the docker engine.

The docker client however should be running in build 14342. I have been able to run the docker client and connect to a docker engine running in a VM.

As to why it's not supported:

WSL is a clean-room kernel reimplementation. So it can't, for both technical and legal reasons, simply take the kernel components of Docker and "make it work". They would need to reverse-engineer years of ongoing kernel development and reimplement it. (Or take some other nontrivial approach.)

Community
  • 1
  • 1
svick
  • 236,525
  • 50
  • 385
  • 514
  • "take the Kernel components" - One would hope that the https://blog.docker.com/2016/09/docker-microsoft-partnership/ would allow them to overcome that. And with "...not supported in short term..." that was May 2016. So a year later and the second "major" release with WSL and the improvements being touted with the networking subsystem I was hoping we were close. Seems to me it is only the file system support that is the thing that needs to be done. Not a small job mind you, but things would be close. – TheEdge Apr 25 '17 at 21:39
  • @TheEdge I don't see how a partnership could overcome the fact that you can't incorporate GPL-licensed code (from the Linux kernel) into a closed-source product (Windows). (Unless *all* relevant contributors agreed to it, which I assume would be far from simple.) – svick Apr 25 '17 at 22:15
  • So how did MS overcome the incorporation of Ubuntu as WSL? – TheEdge Apr 26 '17 at 11:42
  • @TheEdge They didn't. WSL is generic and contains no Linux code, it just emulates the interface of Linux. Ubuntu on Windows, which runs on top of WSL, downloads the actual open-source Ubuntu when you first start it. So no part of Windows contains any code taken from Linux. – svick Apr 26 '17 at 12:11
  • So then without violating GPL "Docker for Windows" could then talk to WSL which would talk to the Ubuntu container and hence the Linux kernel. And we end up where I wanted to be that "Docker for Windows" uses Ubuntu (via WSL) to be the container host and obviate the need to have an unecessary Hyper-V managed Linix VM. As MS and Docker have a commercial relationship I would think Docker would be happy to collaborate with MS to talk to WSL. – TheEdge Apr 26 '17 at 12:47
  • @TheEdge There is no Linux kernel in WSL, Ubuntu on Windows contains the Ubuntu userland, but the kernel is emulated. WSL could emulate this part of the Linux kernel too, but that's the part that is not simple. And you can't just download kernel code and run it on top of a thin emulation layer, like you can with user-mode code. – svick Apr 26 '17 at 12:55
  • Aaah, thanks that was the part I was missing. Much appreciated your time to explain this. – TheEdge Apr 26 '17 at 12:59