Skip to content

Commit 118e376

Browse files
committed
dockerfiles: windows: Avoit to use recommended components on ltsc2025
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 610a125 commit 118e376

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dockerfiles/Dockerfile.windows

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#
1313

1414
ARG WINDOWS_VERSION=ltsc2019
15+
ENV WINDOWS_VERSION="$WINDOWS_VERSION"
1516

1617
# Builder Image - Windows Server Core
1718
FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION AS builder-base
@@ -29,6 +30,9 @@ RUN $msvs_build_tools_dist_name=\"vs_buildtools.exe\"; `
2930
$msvs_build_tools_channel=\"C:\local\VisualStudio.chman\"; `
3031
$msvs_build_tools_dist_url=\"${env:MSVS_BUILD_TOOLS_DOWNLOAD_URL}/${env:MSVS_BUILD_TOOLS_VERSION}/release/${msvs_build_tools_dist_name}\"; `
3132
$msvs_build_tools_channel_url=\"${env:MSVS_BUILD_TOOLS_DOWNLOAD_URL}/${env:MSVS_BUILD_TOOLS_VERSION}/release/channel\"; `
33+
# Bydefault includeRecommended is absent when using ltsc2025
34+
$includeRecommended=\"--includeRecommended\"; `
35+
if (\"${env:WINDOWS_VERSION}\" -eq \"ltsc2025\") { $includeRecommended=\"\" }; `
3236
Write-Host \"Downloading Visual Studio Build Tools...\"; `
3337
Write-Host \"${msvs_build_tools_dist_url} -> ${msvs_build_tools_dist}\"; `
3438
Write-Host \"${msvs_build_tools_channel_url} -> ${msvs_build_tools_channel}\"; `
@@ -41,7 +45,8 @@ RUN $msvs_build_tools_dist_name=\"vs_buildtools.exe\"; `
4145
\"--channelUri ${msvs_build_tools_channel}\", `
4246
\"--installChannelUri ${msvs_build_tools_channel}\", `
4347
'--add Microsoft.VisualStudio.Workload.VCTools', `
44-
'--includeRecommended' -NoNewWindow -Wait; `
48+
$includeRecommended `
49+
-NoNewWindow -Wait; `
4550
Remove-Item -Force \"${msvs_build_tools_dist}\";
4651

4752

0 commit comments

Comments
 (0)