Skip to content

Commit fb9104d

Browse files
authored
Update Windows Docker images (#2579)
### Issues: Resolves #P274195896 ### Description of changes: - Create a MSVC 2019 image to prepare for the migration of MSVC tests from GHA to CodeBuild - Patch MSVC 2015 image to remove its dependency on hardcoded SDK version By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
1 parent 7b65d53 commit fb9104d

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

tests/ci/docker_images/windows/build_images.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
Invoke-Command { docker build -t aws-lc/windows-2022:base .\windows-2022_base }
77
Invoke-Command { docker build -t windows-2022:vs2015 .\windows-2022_vs2015 }
88
Invoke-Command { docker build -t windows-2022:vs2017 .\windows-2022_vs2017 }
9+
Invoke-Command { docker build -t windows-2022:vs2019 .\windows-2022_vs2019 }
910
Invoke-Command { docker build -t windows-2022:vs2022 .\windows-2022_vs2022 }

tests/ci/docker_images/windows/push_images.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ Write-Host "$ECS_REPO"
1414

1515
Tag-And-Push-Image "windows-2022:vs2015" "${ECS_REPO}:windows-2022_vs2015"
1616
Tag-And-Push-Image "windows-2022:vs2017" "${ECS_REPO}:windows-2022_vs2017"
17+
Tag-And-Push-Image "windows-2022:vs2019" "${ECS_REPO}:windows-2022_vs2019"
1718
Tag-And-Push-Image "windows-2022:vs2022" "${ECS_REPO}:windows-2022_vs2022"

tests/ci/docker_images/windows/windows-2022_vs2015/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ RUN `
2727
# Add msbuild and cl to PATH
2828
RUN setx /M PATH "%PATH%;C:\Program Files (x86)\MSBuild\14.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin"
2929

30-
# Replace Windows SDK with the correct binary path. vcvarsall.bat for MSVC2015 does not account for the nested directory.
30+
# Dynamically get the installed SDK version
31+
RUN for /f "tokens=*" %a in ('dir /b /ad "C:\Program Files (x86)\Windows Kits\10\Include\10.0*"') do setx /M SDKVERSION %a
32+
33+
# Replace Windows SDK with the correct binary path. vcvarsall.bat for MSVC2015 does not account for the nested directory
3134
RUN rmdir /s /Q "C:\Program Files (x86)\Windows Kits\10\bin\x64" && `
3235
rmdir /s /Q "C:\Program Files (x86)\Windows Kits\10\bin\x86" && `
33-
move "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64" "C:\Program Files (x86)\Windows Kits\10\bin" && `
34-
move "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86" "C:\Program Files (x86)\Windows Kits\10\bin"
36+
move "C:\Program Files (x86)\Windows Kits\10\bin\%SDKVERSION%\x64" "C:\Program Files (x86)\Windows Kits\10\bin" && `
37+
move "C:\Program Files (x86)\Windows Kits\10\bin\%SDKVERSION%\x86" "C:\Program Files (x86)\Windows Kits\10\bin"
3538

3639
CMD [ "cmd.exe" ]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# escape=`
2+
3+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
# SPDX-License-Identifier: Apache-2.0 OR ISC
5+
6+
# Keep parity with the upstream tags at https://hub.docker.com/_/microsoft-windows-servercore
7+
FROM aws-lc/windows-2022:base
8+
9+
SHELL ["cmd", "/S", "/C"]
10+
RUN `
11+
# Download the Build Tools bootstrapper.
12+
curl -SL --output vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe `
13+
`
14+
# Install MSVC2019 Build Tools with Windows SDK
15+
&& (start /w vs_buildtools.exe --quiet --wait --norestart --nocache `
16+
--add Microsoft.VisualStudio.Workload.VCTools `
17+
--add Microsoft.VisualStudio.Component.VC.CLI.Support `
18+
--add Microsoft.VisualStudio.Component.VC.CMake.Project `
19+
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 `
20+
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
21+
|| IF "%ERRORLEVEL%"=="3010" EXIT 0) `
22+
`
23+
# Cleanup
24+
&& del /q vs_buildtools.exe
25+
26+
RUN setx /M PATH "%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
27+
28+
CMD [ "cmd.exe" ]

0 commit comments

Comments
 (0)