Linux Docker EE Containers on Windows Server 2016

Andrew Sumner picture Andrew Sumner · Aug 1, 2019 · Viewed 8.5k times · Source

Are there any update to date guides on how to use Linux containers in Docker EE for Windows Server 2016? All guides I have found (such as this one) are using the preview edition which from what I can tell is two major releases and 2 years out of date.

An additional problem I have is that I have to download and install docker manually as the server doesn't have a direct internet connection. Container images will be downloaded via Artifactory.

Answer

beruic picture beruic · Aug 28, 2019

NOTE: WSL2

With the release of WSL 2, please be mindful that parts (if not all) off the below is very likely to be outdated.

Original post:


Update:

I previously forgot to mention that before you install, you need to have the Hyper-V Role installed. If you server is a VM, make sure that you have enabled nested virtualization.

Original answer

I don't know of any updated guides, but I have come up with the following from various sources (sources in the bottom), which is confirmed to work for running LCOW on Windows Server 2019:

Basically, you install a normal up-to-date Docker, enable experimental and fix the kernel path.

Assuming that Docker is not already installed, and never has been, running the following commands in an elevated PowerShell get you there:

PS C:\...> Install-Module DockerMsftProvider -Force

PS C:\...> Install-Package Docker -ProviderName DockerMsftProvider -Force

PS C:\...> Restart-Computer

PS C:\...> $configfile =@"
{
    "experimental":true
}
"@

PS C:\...> $configfile|Out-File -FilePath c:\ProgramData\docker\config\daemon.json -Encoding ascii -Force

PS C:\...> [Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine")

PS C:\...> Restart-Service Docker

Then you need to go to https://github.com/linuxkit/lcow/releases and download the newest release and unpack it to C:\Program Files\Linux Containers.

If necessary, rename the file bootx64.efi to kernel.

Note

Please check out the last of the sources that mention some applications that will not work. I am still struggling with switching it to the old method of running the containers in a Moby VM for this specific reason.

Sources: