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.
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
.
Alternatively, just 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
Update:
I Previously forgot to mention that before you continue install, you need to have the Hyper-V Role installed. If you server is a VM, make sure that you have enabled nested virtualization.
来源:https://stackoverflow.com/questions/57317141/linux-docker-ee-containers-on-windows-server-2016