As mentioned Microsoft released the final version of Windows Server 1709 in the last week. Windows Server 1709 brings a couple of new improvements, especially in the container space. Microsoft and Docker are working on bringing Linux Container support to Windows Server, so you can now run Windows and Linux Container at the same time on a Windows Server Container Host running Windows Server 1709 or Windows 10 with the Fall Creators Update (1709).
In this post I want to show you how you setup up a Container Host to run Windows and Linux Containers at the same time using Docker.
Create Container Host Virtual Machine
If you run Docker on a physical server you can skip this step. If you want to run Docker Containers using Linux inside a Virtual Machine running on Hyper-V you should enable Nested Virtualization for the Container Host Virtual Machine. You can do this by running the following command:
Get-VM *WinContainerHost* | Set-VMProcessor -ExposeVirtualizationExtensions $true
if you want to do this on a Hyper-V Server in Azure, check out this post: How to setup Nested Virtualization in Microsoft Azure
Install Docker Enterprise Edition Preview on Windows Server 1709
First you have to install Docker Enterprise Edition Preview on your Windows Server 1709 container host. You can install the Docker EE preview using PowerShell package management, using the following commands:
Install-Module DockerProvider Install-Package Docker -ProviderName DockerProvider -RequiredVersion preview
As mentioned this is a preview version of Docker EE which enables a bunch of new features, to run Docker in production environments please use Docker EE 17.06.
Enable Docker Linux Containers on Windows
The preview Docker EE package includes a full LinuxKit system (13MB) for use when running Docker Linux containers. To enable this use the following command:
[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine") Restart-Service Docker
to disable it again use the following:
[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", $null, "Machine") Restart-Service Docker
Run Docker Linux Container on Windows Server
Now you are able to run Linux Containers on Windows Server 1709.
docker run ubuntu
for fun you can also run Nyancat!
docker run -it supertest2014/nyan
Things are still in preview, so don’t expect to work 100% :)
Tags: Container, Docker, Hyper-V, Hyper-V Container, Hyper-V Container Linux Container, Microsoft, PowerShell, Windows, Windows Server, Windows Server 1709 Last modified: August 24, 2018
Is it available on Azure?
You mention running Windows and Linux containers at the same time. I can’t get this to work following your instructions above.
When I set LCOW_SUPPORTED to 1 I can run Linux containers, but not Windows containers. The Windows container download or run always fails, when I set it back to null the Windows containers run but the Linux containers do not.
I am on Server 1709, fresh install. This is installed on VMWare ESXi with a snapshot. I’ve rolled the snapshot back to fresh install several times and tried a few different things with no luck.
Am I missing something obvious?
Hey Dave
Running it side by side is not fully integrated in the preview yet. They are still working on it. :)
Hey Tom.. trying to run Linux container on 1709 in Azure and although I think I followed the steps above correctly, when I “run Ubuntu” I get “docker: no matching manifest for windows/amd64 in the manifest list entries.” and when I “run -it supertest24/nyan”, I get an image download followed by
“latest: Pulling from supertest2014/nyan
a3ed95caeb02: Extracting [==================================================>] 32B/32B
e472211e4879: Download complete
bba4bc236bcb: Download complete
9d52b79a9349: Download complete
c1f720c0024d: Download complete
docker: failed to register layer: re-exec error: exit status 1: output: ProcessBaseLayer C:\ProgramData\docker\windowsfilter\3b0323ad6b5d7d5f8054e603e5cfce352ac6bab598db37aac1ea702f2bd2aa22: The system cannot find the path specified.”
Seems like I really missed something.
To help: 1) I am running on a D2S-V3 instance with 1709 Datacenter (not the “with containers” version). Docker version is 17.06.3-ee-1-tp6, 2) I did not do the optional step of adding extra storage, and 3) LCOW_SUPPORTED reports back as “1” in powershell.
My actual containerized Linux app fails with “ERROR: image operating system “linux” cannot be used on this platform” which is why I was so hopeful that I could prove a Linux app would run.
Any advice?
Does not work at all.
I still get error:
docker -H localhost run -d -p 5000:5000 –restart=always –name registry registry:2
Unable to find image ‘registry:2’ locally
2: Pulling from library/registry
C:\Program Files\docker\docker.exe: no supported platform found in manifest list.
See ‘C:\Program Files\docker\docker.exe run –help’.
Are linux containers on Windows feasible for a production workload?