hack: dockerfiles: start off a nanoserver plus image#178
Open
profnandaa wants to merge 1 commit intomicrosoft:hacks/sample-scriptsfrom
Open
hack: dockerfiles: start off a nanoserver plus image#178profnandaa wants to merge 1 commit intomicrosoft:hacks/sample-scriptsfrom
profnandaa wants to merge 1 commit intomicrosoft:hacks/sample-scriptsfrom
Conversation
the official mcr.microsoft.com/windows/nanoserver:ltsc2022 image does not ship with some binaries so as to reduce the image size. Some of those are needed for testing, etc. We are therefore creating a custom nanoserver aka nanoserver-plus image that ships with these binaries, and more others as needed Signed-off-by: Anthony Nandaa <profnandaa@gmail.com>
0f5cae0 to
ae939ce
Compare
mloskot
suggested changes
Jan 12, 2026
Contributor
There was a problem hiding this comment.
I think the extra manual step running get_binaries.ps1 can be avoided with multi-stage build, with something like this:
FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS tools
WORKDIR /tools
RUN copy /y "C:\Windows\System32\fc.exe" .
RUN copy /y "C:\Windows\System32\whoami.exe" .
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
COPY --from=tools /tools/*.exe /Windows/System32/
.../cc @bobsira
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because of reducing the footprint, nanoserver usually ships with as minimal binaries as possible. A few of those binaries left out are important for running integration tests on buildkit, for example comparing two files with
fc.exe, that's a legacy tool found atC:\Windows\System32\fc.exe. The alternative is to use ServerCore which is very huge, and makes for instance one test to take 10x the time. e.g.With servercore:
With nanoserver (plus):