-
Notifications
You must be signed in to change notification settings - Fork 346
Add Dockerfiles for Windows Server 2025 #1183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
8b2ed5d
abb2fc4
dc9da19
80de66c
d090f63
742c948
674f1fd
e67b815
b9cd78b
6228370
32fa282
4228d93
ffcc36e
6691140
34e11d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,20 +1,55 @@ | ||||||
{{ | ||||||
set isServer2025 to OS_VERSION_NUMBER = "ltsc2025" ^ | ||||||
set isServer2022 to OS_VERSION_NUMBER = "ltsc2022" ^ | ||||||
set isServer2019 to OS_VERSION_NUMBER = "ltsc2019" ^ | ||||||
set isServer2016 to OS_VERSION_NUMBER = "ltsc2016" ^ | ||||||
set isNet35 to PRODUCT_VERSION = "3.5" ^ | ||||||
set isNet462 to PRODUCT_VERSION = "4.6.2" ^ | ||||||
set isNet472 to PRODUCT_VERSION = "4.7.2" ^ | ||||||
set isNet48 to PRODUCT_VERSION = "4.8" ^ | ||||||
set isNet481 to PRODUCT_VERSION = "4.8.1" ^ | ||||||
|
||||||
set kbExists to VARIABLES[cat("kb|", OS_VERSION_NUMBER, "|", PRODUCT_VERSION)] != void ^ | ||||||
set is48SecurityRelease to (VARIABLES[cat("4.8-is-security-release|", OS_VERSION_NUMBER)] = "true") ^ | ||||||
set apply35Patch to (VARIABLES[cat("kb|", OS_VERSION_NUMBER, "|", PRODUCT_VERSION)] != void && PRODUCT_VERSION = "3.5" && OS_VERSION_NUMBER != "ltsc2019") ^ | ||||||
set applyPatch to VARIABLES[cat("kb|", OS_VERSION_NUMBER, "|", PRODUCT_VERSION)] != void && | ||||||
!( | ||||||
(OS_VERSION_NUMBER = "ltsc2019" && PRODUCT_VERSION = "4.7.2") || | ||||||
( | ||||||
|
||||||
set apply35Patch to kbExists && isNet35 | ||||||
&& !isServer2019 | ||||||
&& !isServer2025 ^ | ||||||
|
||||||
set applyPatch to kbExists | ||||||
&& !(isServer2025 && isNet481) | ||||||
&& !(isServer2019 && isNet472) | ||||||
&& !( | ||||||
(isServer2019 && isNet472) || | ||||||
( | ||||||
(PRODUCT_VERSION = "4.8" && OS_VERSION_NUMBER != "ltsc2019") || | ||||||
(PRODUCT_VERSION = "3.5" && OS_VERSION_NUMBER != "ltsc2019") | ||||||
) && | ||||||
is48SecurityRelease | ||||||
) | ||||||
) | ||||||
( | ||||||
(isNet48 && !isServer2019) || | ||||||
(isNet35 && !isServer2019) | ||||||
) && | ||||||
is48SecurityRelease | ||||||
) | ||||||
) ^ | ||||||
|
||||||
set winver to when( | ||||||
isServer2016 || isServer2019 || isServer2022, | ||||||
"windows10.0", | ||||||
"windows11.0") ^ | ||||||
|
||||||
_ set applyPatch to when(isServer2025, isServer2025, applyPatch) ^ | ||||||
_ set apply35Patch to when(isServer2025, !isServer2025, apply35Patch) ^ | ||||||
|
||||||
set repo to "mcr.microsoft.com/windows/servercore" ^ | ||||||
set tag to cat(OS_VERSION_NUMBER, "-amd64") ^ | ||||||
|
||||||
set netfx3CabFilename to when(isServer2025, | ||||||
"microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~en-us~.cab" | ||||||
"microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~~.cab") ^ | ||||||
|
||||||
set fromImage to cat(repo, ":", tag) | ||||||
|
||||||
}}# escape=` | ||||||
|
||||||
FROM mcr.microsoft.com/windows/servercore:{{OS_VERSION_NUMBER}}-amd64 | ||||||
FROM {{fromImage}} | ||||||
lbussell marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
||||||
ENV {{ | ||||||
if OS_VERSION_NUMBER != "ltsc2019" || PRODUCT_VERSION = "4.8" || PRODUCT_VERSION = "4.8.1" | ||||||
|
@@ -26,16 +61,20 @@ if OS_VERSION_NUMBER != "ltsc2019" || PRODUCT_VERSION = "4.8" || PRODUCT_VERSION | |||||
}}COMPLUS_NGenProtectedProcess_FeatureEnabled=0 | ||||||
|
||||||
RUN ` | ||||||
{{if PRODUCT_VERSION = "3.5" | ||||||
{{if PRODUCT_VERSION = "3.5" && isServer2025 | ||||||
: # Install .NET Fx 3.5 | ||||||
dism /Online /Add-Capability /CapabilityName:NetFx3 ` | ||||||
` | ||||||
^elif PRODUCT_VERSION = "3.5" | ||||||
: # Install .NET Fx 3.5 | ||||||
curl -fSLo microsoft-windows-netfx3.zip https://dotnetbinaries.blob.core.windows.net/dockerassets/microsoft-windows-netfx3-{{OS_VERSION_NUMBER}}.zip ` | ||||||
&& tar -zxf microsoft-windows-netfx3.zip ` | ||||||
&& del /F /Q microsoft-windows-netfx3.zip ` | ||||||
&& dism /Online /Quiet /Add-Package /PackagePath:.\microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~~.cab ` | ||||||
&& del microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~~.cab ` | ||||||
&& dism /Online /Quiet /Add-Package /PackagePath:.\{{netfx3CabFilename}} ` | ||||||
&& del {{netfx3CabFilename}} ` | ||||||
&& powershell Remove-Item -Force -Recurse ${Env:TEMP}\* ` | ||||||
` | ||||||
^elif (OS_VERSION_NUMBER = "ltsc2019" && PRODUCT_VERSION = "4.8") || PRODUCT_VERSION = "4.8.1" | ||||||
^elif (OS_VERSION_NUMBER = "ltsc2019" && PRODUCT_VERSION = "4.8") || (!isServer2025 && PRODUCT_VERSION = "4.8.1") | ||||||
: # Install .NET Fx {{PRODUCT_VERSION}} | ||||||
curl -fSLo dotnet-framework-installer.exe {{VARIABLES[cat(PRODUCT_VERSION, "|url")]}} ` | ||||||
&& .\dotnet-framework-installer.exe /q ` | ||||||
|
@@ -48,7 +87,7 @@ RUN ` | |||||
&& mkdir patch ` | ||||||
&& expand patch.msu patch -F:* ` | ||||||
&& del /F /Q patch.msu ` | ||||||
&& dism /Online /Quiet /Add-Package /PackagePath:C:\patch\windows10.0-{{VARIABLES[cat("kb|", OS_VERSION_NUMBER, "|", PRODUCT_VERSION)]}}-x64{{if OS_VERSION_NUMBER = "ltsc2022":-ndp48}}.cab ` | ||||||
&& dism /Online /Quiet /Add-Package /PackagePath:C:\patch\{{winver}}-{{VARIABLES[cat("kb|", OS_VERSION_NUMBER, "|", PRODUCT_VERSION)]}}-x64{{if OS_VERSION_NUMBER = "ltsc2022":-ndp48}}.cab ` | ||||||
&& rmdir /S /Q patch ` | ||||||
` | ||||||
}}{{if applyPatch | ||||||
|
@@ -57,7 +96,7 @@ RUN ` | |||||
&& mkdir patch ` | ||||||
&& expand patch.msu patch -F:* ` | ||||||
&& del /F /Q patch.msu ` | ||||||
&& dism /Online /Quiet /Add-Package /PackagePath:C:\patch\windows10.0-{{VARIABLES[cat("kb|", OS_VERSION_NUMBER, "|", when(PRODUCT_VERSION = "3.5", "default", PRODUCT_VERSION))]}}-x64{{if OS_VERSION_NUMBER != "ltsc2019" || PRODUCT_VERSION = "4.8":-ndp48}}{{if PRODUCT_VERSION = "4.8.1":1}}.cab ` | ||||||
&& dism /Online /Quiet /Add-Package /PackagePath:C:\patch\{{winver}}-{{VARIABLES[cat("kb|", OS_VERSION_NUMBER, "|", when(PRODUCT_VERSION = "3.5", "default", PRODUCT_VERSION))]}}-x64{{if OS_VERSION_NUMBER != "ltsc2019" || PRODUCT_VERSION = "4.8":-ndp48}}{{if isServer2025 || isNet481:1}}.cab ` | ||||||
|
&& dism /Online /Quiet /Add-Package /PackagePath:C:\patch\{{winver}}-{{VARIABLES[cat("kb|", OS_VERSION_NUMBER, "|", when(PRODUCT_VERSION = "3.5", "default", PRODUCT_VERSION))]}}-x64{{if OS_VERSION_NUMBER != "ltsc2019" || PRODUCT_VERSION = "4.8":-ndp48}}{{if isServer2025 || isNet481:1}}.cab ` | |
&& dism /Online /Quiet /Add-Package /PackagePath:C:\patch\{{winver}}-{{VARIABLES[cat("kb|", OS_VERSION_NUMBER, "|", when(PRODUCT_VERSION = "3.5", "default", PRODUCT_VERSION))]}}-x64{{if OS_VERSION_NUMBER != "ltsc2019" || PRODUCT_VERSION = "4.8":-ndp48}}{{if isNet481:1}}.cab ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is necessary. For server 2025, there is no distinction between .NET 3.5 latest patch .NET 4.8.1 latest patch. To keep the implementation simpler, I directed both of those cases to this applyPatch
branch. Either we need to keep this condition so that the filename is correct in the Server 2025 3.5 Dockerfile, or we can add the 1
suffix to the "apply latest 3.5 patch" instructions instead. Then the only difference would be the comment.
Uh oh!
There was an error while loading. Please reload this page.