Skip to content

Commit 0f5cae0

Browse files
committed
hack: dockerfiles: start off a nanoserver plus image
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>
1 parent e41f8c7 commit 0f5cae0

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

hacks/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
private/
2+
bin/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
2+
3+
# this is a minimal image based on nanoserver
4+
# mainly for the purpose of testing, e.g. integration
5+
# tests on moby/buildkit.
6+
7+
# before building the image, run ./get_binaries.ps1
8+
# from the host. This dumps all the required binaries
9+
# in the ./bin directory that is later moved to
10+
# C:\Windows\system32 to be accessed within %PATH%
11+
12+
COPY ./bin/* /Windows/System32/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
# files to copy from Windows host.
3+
# this are mainly legacy files that don't have any
4+
# extra dependencies.
5+
$filePaths = @(
6+
"C:\Windows\System32\fc.exe",
7+
"C:\Windows\System32\whoami.exe"
8+
)
9+
10+
$dest = "./bin"
11+
12+
if (-not (Test-Path -Path $dest)) {
13+
New-Item -ItemType Directory -Path $dest
14+
}
15+
16+
foreach ($filePath in $filePaths) {
17+
Copy-Item -Path $filePath -Destination $dest
18+
}

0 commit comments

Comments
 (0)