运行 Docker Windows 子系统中的 .Net Core Linux

Running .Net Core in Docker in Windows Subsystem for Linux

实际上我想在 Docker 中使用 .NET Core。

因此,根据我从 的理解,为了给自己最大的灵活性,我会安装 "Docker For Windows"。意味着我最终可以将我的 .Core 应用程序部署到 Windows 或 Linux 容器中。但是 Linux 容器仍然是 Hyper-V 管理的 Linux 容器。

1) 有没有办法在 Windows 10 创意者更新中使用 Linux (WSL) 的 Windows 子系统来执行此操作?似乎比 Windows/Docker 为我管理一个单独的 Linux 虚拟机开销要少?

不,running Docker containers in WSL is not supported(link 我的):

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.

至于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.)