Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux Docker EE Containers on Windows Server 2016

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.

like image 695
Andrew Sumner Avatar asked Aug 01 '19 21:08

Andrew Sumner


People also ask

Is Docker ee free for Windows Server 2016?

Docker Engine - Enterprise is available at no additional cost to all Windows Server 2016 customers. Docker works the same way on Windows as it does on Linux: leverage the same Docker CLI, API, image format, and Docker registry services for both Windows and Linux images in the same cluster.

Is Docker compatible with Windows Server 2016?

Docker Enterprise Edition is supported for use with Enterprise Server only on Windows Server 2016 so if you are using Windows 10 you must install Docker Desktop.

Can Windows run Linux Docker containers?

Docker has been able to run Linux containers on Windows desktop since it was first released in 2016 (before Hyper-V isolation or Linux containers on Windows were available) using a LinuxKit based virtual machine running on Hyper-V.


1 Answers

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:

  • https://docs.docker.com/install/windows/docker-ee/
  • https://www.altaro.com/msp-dojo/linux-containers-windows-server-2019/
  • https://computingforgeeks.com/how-to-run-docker-containers-on-windows-server-2019/
  • https://github.com/moby/moby/issues/38320#issuecomment-446922198
  • https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/linux-containers
like image 184
beruic Avatar answered Oct 31 '22 06:10

beruic