Skip to content

Commit 32fa282

Browse files
committed
Clean up runtime template
1 parent 6228370 commit 32fa282

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

eng/dockerfile-templates/runtime/Dockerfile

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
set kbExists to VARIABLES[cat("kb|", OS_VERSION_NUMBER, "|", PRODUCT_VERSION)] != void ^
1313
set is48SecurityRelease to (VARIABLES[cat("4.8-is-security-release|", OS_VERSION_NUMBER)] = "true") ^
1414

15-
set apply35Patch to kbExists && isNet35
15+
set apply35Patch to kbExists
16+
&& isNet35
1617
&& !isServer2019
1718
&& !isServer2025 ^
1819

@@ -30,23 +31,16 @@
3031
)
3132
) ^
3233

34+
set installNet35UsingWU to isServer2025 ^
35+
3336
set winver to when(
3437
isServer2016 || isServer2019 || isServer2022,
3538
"windows10.0",
36-
"windows11.0") ^
37-
38-
set repo to "mcr.microsoft.com/windows/servercore" ^
39-
set tag to cat(OS_VERSION_NUMBER, "-amd64") ^
40-
41-
set netfx3CabFilename to when(isServer2025,
42-
"microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~en-us~.cab"
43-
"microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~~.cab") ^
44-
45-
set fromImage to cat(repo, ":", tag)
39+
"windows11.0")
4640

4741
}}# escape=`
4842

49-
FROM {{fromImage}}
43+
FROM mcr.microsoft.com/windows/servercore:{{OS_VERSION_NUMBER}}-amd64
5044

5145
ENV {{
5246
if OS_VERSION_NUMBER != "ltsc2019" || PRODUCT_VERSION = "4.8" || PRODUCT_VERSION = "4.8.1"
@@ -58,7 +52,7 @@ if OS_VERSION_NUMBER != "ltsc2019" || PRODUCT_VERSION = "4.8" || PRODUCT_VERSION
5852
}}COMPLUS_NGenProtectedProcess_FeatureEnabled=0
5953

6054
RUN `
61-
{{if PRODUCT_VERSION = "3.5" && isServer2025
55+
{{if isNet35 && installNet35UsingWU
6256
: # Install .NET Fx 3.5
6357
dism /Online /Add-Capability /CapabilityName:NetFx3 `
6458
`
@@ -67,8 +61,8 @@ RUN `
6761
curl -fSLo microsoft-windows-netfx3.zip https://dotnetbinaries.blob.core.windows.net/dockerassets/microsoft-windows-netfx3-{{OS_VERSION_NUMBER}}.zip `
6862
&& tar -zxf microsoft-windows-netfx3.zip `
6963
&& del /F /Q microsoft-windows-netfx3.zip `
70-
&& dism /Online /Quiet /Add-Package /PackagePath:.\{{netfx3CabFilename}} `
71-
&& del {{netfx3CabFilename}} `
64+
&& dism /Online /Quiet /Add-Package /PackagePath:.\microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~~.cab `
65+
&& del microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~~.cab `
7266
&& powershell Remove-Item -Force -Recurse ${Env:TEMP}\* `
7367
`
7468
^elif (OS_VERSION_NUMBER = "ltsc2019" && PRODUCT_VERSION = "4.8") || (!isServer2025 && PRODUCT_VERSION = "4.8.1")

0 commit comments

Comments
 (0)