blob: 4502a591f5b21222c8bde3362c657370039de2c3 [file] [log] [blame]
James E. King III278528c2019-01-11 12:17:44 -05001# escape=`
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080016FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022
James E. King III278528c2019-01-11 12:17:44 -050017
18# Restore the default Windows shell for correct batch processing below.
19SHELL ["cmd", "/S", "/C"]
20
21# Install Build Tools excluding workloads and components with known issues.
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080022ADD --checksum=sha256:ca11782db44225d313c9887b4254dfa57c5b72fef025bf620c81c43dff73c6ed https://aka.ms/vs/15/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
James E. King III278528c2019-01-11 12:17:44 -050023RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
24 --installPath C:\BuildTools `
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080025 --add Microsoft.VisualStudio.Workload.VCTools `
26 --add Microsoft.VisualStudio.Component.Windows10SDK.19041 `
James E. King III278528c2019-01-11 12:17:44 -050027 || IF "%ERRORLEVEL%"=="3010" EXIT 0
28RUN DEL C:\TEMP\vs_buildtools.exe
29
30# Install CMake
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080031ADD --checksum=sha256:a10fc2527ec0727a5913acd310cddafba1e5b4ca765ca23cc6a53c55eebb7c1 https://github.com/Kitware/CMake/releases/download/v4.1.2/cmake-4.1.2-windows-x86_64.msi C:\TEMP\cmake.msi
James E. King III278528c2019-01-11 12:17:44 -050032RUN msiexec.exe /i C:\TEMP\cmake.msi /qn && `
33 SETX PATH "%PATH%;C:\Program Files\CMake\bin" && `
34 DEL C:\TEMP\cmake.msi
35
36# Install boost (for the thrift runtime library build)
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080037ADD --checksum=sha256:ae6ade62886fd9a6930c95f116a33e940224f0cb7f791b01afd7dd1ceca360fe https://boost.teeks99.com/bin/1.88.0/boost_1_88_0-msvc-14.1-64.exe C:\TEMP\boost.exe
38ENV BOOST_ROOT=C:\Libraries\boost_1_88_0
39RUN C:\TEMP\boost.exe /DIR=%BOOST_ROOT% /SILENT && `
40 DEL C:\TEMP\boost.exe && `
41 SETX BOOST_LIBRARYDIR "%BOOST_ROOT%\lib64-msvc-14.1" && `
42 SETX PATH "%BOOST_LIBRARYDIR%;%PATH%"
James E. King III278528c2019-01-11 12:17:44 -050043
44# Install chocolatey
45RUN @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" `
46 -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command `
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080047 "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" `
James E. King III278528c2019-01-11 12:17:44 -050048 && SETX PATH "%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
49
50# Install winflexbison (for the thrift compiler build)
51RUN choco install winflexbison3 -y
52
53# Install 7zip and curl (used by the libevent and zlib build scripts)
54RUN choco install 7zip curl -y
55
56# Install libevent
57COPY appveyor\build-libevent.bat C:\TEMP\build-libevent.bat
58ENV LIBEVENT_VERSION=2.1.8
59ENV WIN3P=C:\TEMP\WIN3P
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080060RUN C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=x64 -host_arch=x64 && `
James E. King III278528c2019-01-11 12:17:44 -050061 MKDIR C:\TEMP\WIN3P && `
62 C:\TEMP\build-libevent.bat && `
63 MKDIR C:\Libraries\libevent-%LIBEVENT_VERSION% && `
64 MOVE C:\TEMP\WIN3P\libevent-%LIBEVENT_VERSION%-stable\include C:\Libraries\libevent-%LIBEVENT_VERSION% && `
65 MOVE C:\TEMP\WIN3P\libevent-%LIBEVENT_VERSION%-stable\lib C:\Libraries\libevent-%LIBEVENT_VERSION% && `
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080066 RMDIR /S /Q C:\TEMP\WIN3P && `
67 SETX LIBEVENT_ROOT "C:\Libraries\libevent-%LIBEVENT_VERSION%"
James E. King III278528c2019-01-11 12:17:44 -050068
69# Install zlib
70COPY appveyor\build-zlib.bat C:\TEMP\build-zlib.bat
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080071ENV ZLIB_VERSION=1.3.1
James E. King III278528c2019-01-11 12:17:44 -050072ENV WIN3P=C:\TEMP\WIN3P
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080073RUN C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=x64 -host_arch=x64 && `
James E. King III278528c2019-01-11 12:17:44 -050074 MKDIR C:\TEMP\WIN3P && `
75 C:\TEMP\build-zlib.bat && `
76 MOVE C:\TEMP\WIN3P\zlib-inst C:\Libraries\zlib-%ZLIB_VERSION% && `
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080077 RMDIR /S /Q C:\TEMP\WIN3P && `
78 SETX ZLIB_ROOT "C:\Libraries\zlib-%ZLIB_VERSION%" && `
79 SETX PATH "%ZLIB_ROOT%\bin;%PATH%"
James E. King III278528c2019-01-11 12:17:44 -050080
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080081# Install OpenSSL 3.6.0
82ADD --checksum=sha256:1ae24eb941ff3c11258d0ad4e6d2cba13360cb52a17d8516fb27352b5e3ed6ad https://slproweb.com/download/Win64OpenSSL-3_6_0.exe C:\TEMP\openssl.exe
James E. King III278528c2019-01-11 12:17:44 -050083RUN C:\TEMP\openssl.exe /silent && `
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080084 DEL C:\TEMP\openssl.exe && `
85 SETX OPENSSL_ROOT "C:\OpenSSL-Win64" && `
86 SETX PATH "%OPENSSL_ROOT%\bin;%PATH%"
James E. King III278528c2019-01-11 12:17:44 -050087
88# Install java
89RUN choco install jdk8 -y
90
James E. King III278528c2019-01-11 12:17:44 -050091# Install python3
92RUN choco install python3 -y
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080093RUN pip install setuptools
James E. King III278528c2019-01-11 12:17:44 -050094
James E. King III6c26e092019-02-07 12:48:27 -050095# Install Adobe Flex 4.6 SDK and set FLEX_HOME so it can be found
Shaoyu Zhang230d0a92025-11-12 00:08:50 -080096ADD --checksum=sha256:622b63f29de44600ff8d4231174a70fcb3085812c0e146a42e91877ca8b46798 http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip C:\Adobe\Flex\SDK\4.6\SDK.zip
James E. King III6c26e092019-02-07 12:48:27 -050097RUN CD C:\Adobe\Flex\SDK\4.6 && `
98 7z x SDK.zip && `
99 DEL SDK.zip && `
100 SETX FLEX_HOME "C:\Adobe\Flex\SDK\4.6"
101
Shaoyu Zhang230d0a92025-11-12 00:08:50 -0800102RUN choco install nodejs -y
103
James E. King III278528c2019-01-11 12:17:44 -0500104# Start developer command prompt with any other commands specified.
Shaoyu Zhang230d0a92025-11-12 00:08:50 -0800105ENTRYPOINT C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=x64 -host_arch=x64 &&
James E. King III278528c2019-01-11 12:17:44 -0500106
107# Default to PowerShell if no other command specified.
Shaoyu Zhang230d0a92025-11-12 00:08:50 -0800108CMD powershell.exe -NoLogo -ExecutionPolicy Bypass