Windows: Experimental: ContainerD runtime#38541
Conversation
9b6dd31 to
d1e947e
Compare
2450a45 to
3df4681
Compare
|
@andrey-ko PTAL |
|
@ddebroy @andrey-ko Waaaaaaay too early and much is in flux. |
6faa18b to
462a806
Compare
Codecov Report
@@ Coverage Diff @@
## master #38541 +/- ##
==========================================
+ Coverage 36.47% 37.01% +0.54%
==========================================
Files 613 610 -3
Lines 45814 45321 -493
==========================================
+ Hits 16709 16775 +66
+ Misses 26823 26260 -563
- Partials 2282 2286 +4 |
1932955 to
c9529d6
Compare
7f97828 to
4936fee
Compare
4936fee to
a63f7b6
Compare
a63f7b6 to
2ebd6d7
Compare
|
Ah, well, whatever information would be useful then (instead of runhcs) 😅 |
|
@andrey-ko when you get a chance, can you have a look a verifying this PR with windows binaries according to the john howard instructions? cc @ddebroy |
|
@jhowardmsft in regards to getting PR jobs modified to test with containerd on windows in the future and getting nightly builds up with the new dependent binaries, we should proceed with that in parallel with this PR cc @dave-tucker (could use msft help on this if you guys got canonical ways to build windows binaries from golang in an automated pipeline) |
|
The |
|
Interesting. It shouldn’t be needed. I’ll fix it as a followup |
Looks like an incorrect format-string somewhere as well 🤔 |
|
@StefanScherer doesn't repro here. Are you POSITIVE you are using the right shim binary? |
|
@jhowardmsft I tried a Dockerfile using double quotes. # escape=`
ARG core=mcr.microsoft.com/windows/servercore:1809
ARG target=mcr.microsoft.com/windows/servercore:1809
FROM $core as download
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV GPG_VERSION 2.3.4
RUN Invoke-WebRequest "https://files.gpg4win.org/gpg4win-vanilla-${env:GPG_VERSION}.exe" -OutFile "gpg4win.exe" -UseBasicParsing ; `
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -WaitSingle line RUN instructions seem to work 🎉 💯. What a relief. RUN @(
"94AE36675C464D64BAFA68DD7434390BDBE9B9C5",
"FD3A5288F042B6850C66B31F09FE44734EB7990E",
"71DCFD284A79C3B38668286BC97EC7A07EDE3FC1",
"DD8F2338BAE7501E3DD5AC78C273792F7D83545D",
"C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8",
"B9AE9905FFD7803F25714661B63B535A4C206CA9",
"77984A986EBC2AA786BC0F66B01FBB92821C587A",
"8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600",
"4ED778F539E3634C779C87C6D7062848A1AB005C",
"A48C2BEE680E841632CD4E44F07496B3EB3C1762",
"B9E2F5981AA6E0CD28160D9FF13993A75599653C"
) | foreach {
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ;
}Sure I can keep single quotes here, but wanted to try out where people might use it. |
|
Is that a regression (the multi-line)? |
|
@jhowardmsft oh the shim was my fault, I accidentally copied the wrong one :-( FROM mcr.microsoft.com/windows/servercore:1809
ENV VERSION=1.2.3
RUN powershell -Command Write-Output "The version is $env:VERSION"
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Write-Output "The version is $env:VERSION"Building this Dockerfile gives me The output is multi-line so there were no quotes in the Write-Output command. My download from the previous Dockerfile fortunately worked without the quotes. |
|
I've access problems with container removal: and looks like it stays forever in "removal in progress state".... |
|
Removal issue known and understood. Needs a fix to the shim which is in flight |
|
@StefanScherer I’m still trying to understand if this is a regression or not. Can you be more precise? |
|
@jhowardmsft I think I remembered something wrong. I kept in my mind that I sometime should test this PR to check an enhancement how we can use quotes in RUN instructions. As I finally had some time today to set everything up I tried it out in the hope that we can use double quotes, but it seems I remembered this wrong. So no regression, it just doesn't work as it would be nice to work. So forget about this false alarm. We should track this in another issue. All other things with containerd work for me on a Server 2019, even docker run --rm. |
|
I’m going to merge this so we can move forward given there are three LGTMs and a slack-LGTM from Derek. @thaJeztah YOLO. |
|
( channeling @jessfraz 😱 😁) |
|
😂🥳🎉 |

Signed-off-by: John Howard jhoward@microsoft.com
Fixes #22874
Fixes #38719
See each of the commit messages for more detail on the changes.
TL;DR
Allows the use of containerd as an experimental runtime for containers on Windows (WCOW being both process and Hyper-V isolation, as well as LCOW).
Detail
Microsoft/hcsshimandMicrosoft/go-winioNote containerd and hcsshim for HCS v2 APIs do not yet support all the required
functionality needed for docker. gMSA and cloning/templating are two obvious omissions. The gaps will be resolved in time - this PR is a stepping stone in migrating Docker on Windows to containerd for those wishing to experiment, not a full switch-over.
How to use
You will need RS5 (goal is for RS1+ and although RS1 is currently enabled, there's some issues still being worked through, so it may be disabled prior to merge) and to start with something like the following:
Window 1:
containerd --log-level debugWindow 2:
$env:DOCKER_WINDOWS_CONTAINERD_RUNTIME=1dockerd --experimental -D --containerd \\.\pipe\containerd-containerdRequired Binaries
You will need the following binary from github.com/containerd/containerd in your path. You will need to make sure this is from master currently, not a 1.2.x branch.
containerd.exe(Do not use
containerd-shim-runhcs-v1.exefrom the containerd repo - if not already, it will be removed very soon. You should use the one from the https://github.com/Microsoft/hcsshim below)You will need the following binaries from https://github.com/Microsoft/hcsshim in your path, again currently from 'master' due to the in-flux current status:
containerd-shim-runhcs-v1.exerunhcs.exe(not required but potentially useful)For LCOW, the following binaries are required:
C:\Program Files\Linux Containers\initrd.imgC:\Program Files\Linux Containers\kernelThis is no different to the current requirements. Linuxkit (https://github.com/linuxkit/lcow) is currently far behind https://github.com/Microsoft/opengcs master, so you may need to build your own initrd.img, as well as kernel. A 4.19 based kernel is preferred.