diff --git a/hacks/.gitignore b/hacks/.gitignore index 7b0f5157..6be5c8bb 100644 --- a/hacks/.gitignore +++ b/hacks/.gitignore @@ -1 +1,2 @@ private/ +bin/ diff --git a/hacks/scripts/dockerfiles/nanoserver_plus/dockerfile b/hacks/scripts/dockerfiles/nanoserver_plus/dockerfile new file mode 100644 index 00000000..5286fb90 --- /dev/null +++ b/hacks/scripts/dockerfiles/nanoserver_plus/dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 + +# this is a minimal image based on nanoserver +# mainly for the purpose of testing, e.g. integration +# tests on moby/buildkit. + +# before building the image, run ./get_binaries.ps1 +# from the host. This dumps all the required binaries +# in the ./bin directory that is later moved to +# C:\Windows\system32 to be accessed within %PATH% + +COPY ./bin/* /Windows/System32/ diff --git a/hacks/scripts/dockerfiles/nanoserver_plus/get_binaries.ps1 b/hacks/scripts/dockerfiles/nanoserver_plus/get_binaries.ps1 new file mode 100644 index 00000000..e29fb303 --- /dev/null +++ b/hacks/scripts/dockerfiles/nanoserver_plus/get_binaries.ps1 @@ -0,0 +1,18 @@ + +# files to copy from Windows host. +# this are mainly legacy binaries that don't have any +# extra dependencies. +$filePaths = @( + "C:\Windows\System32\fc.exe", + "C:\Windows\System32\whoami.exe" +) + +$dest = "./bin" + +if (-not (Test-Path -Path $dest)) { + New-Item -ItemType Directory -Path $dest +} + +foreach ($filePath in $filePaths) { + Copy-Item -Path $filePath -Destination $dest +}