There are a few steps that you need to follow to get things working though.
- You need to be working on a later release of docker (at least 18.03 I believe)
- Switch to windows containers:
- and have the experimental features enabled :
- You need to then install the LinuxKit on your machine, which is luckily fairly simple:
- Download the latest release
- Run an elevated powershell prompt and execute the following:
Remove-Item "$env:ProgramFiles\Linux Containers" -Force -Recurse
Expand-Archive release.zip -DestinationPath "$Env:ProgramFiles\Linux Containers\." - Now, the first thing I tried was to run the MS-SQL container on Linux (as did brian) and we both ran into the same memory issue. It is a bit hairy to fix, and you may not even need to do this depending on what you are trying to run, but just in case:
- We need to recompile the docker deamon. Luckily there are steps to do exactly that, in a docker container. Brian explains it quite well, but missed a few steps that I will fill in:
- You will find the
client_local_windows.go
file in thelibcontainerd
directory under the root of the docker source code - You will need to find the
configuration := &hcsshim.ContainerConfig{
section, round about line 360. Then insert the
HvPartition: true,
Name: id,
SystemType: "container",
ContainerType: "linux",
Owner: defaultOwner,
TerminateOnLastHandleClosed: true,
}MemoryMaximumInMB: 4096,
in that config - When running step 4 (from the steps) to build the images, add the "
-m 2GB
" arg., else you will have an "out of memory" error - Finally, only copy over the "dockerd.exe" file to the original docker install folder under the resources directory. On my machine :
C:\Program Files\Docker\Docker\resources
Magic!
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.