Linux Docker EE Containers on Windows Server 2016

老子叫甜甜 提交于 2019-12-04 04:42:48

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/57317141/linux-docker-ee-containers-on-windows-server-2016

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!