1
+ # escape=`
2
+
3
+ ARG BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022-amd64
4
+
5
+ FROM ${BASE_IMAGE}
6
+
7
+ SHELL ["cmd" , "/S" , "/C" ]
8
+
9
+ USER ContainerAdministrator
10
+
11
+ ENV THIS_PROJECT_WORKING_DIRECTORY="C:\d ocker"
12
+ ENV THIS_PROJECT_NABLA_DIRECTORY="C:/Users/ContainerAdministrator/Nabla/bind"
13
+ ENV VULKAN_SDK_INSTALL_DIRECTORY="${THIS_PROJECT_WORKING_DIRECTORY}\d ependencies\V ulkanSDK"
14
+ ENV VS_INSTALL_DIRECTORY="${THIS_PROJECT_WORKING_DIRECTORY}\d ependencies\V S\B uildTools"
15
+
16
+ RUN `
17
+ # Download the Build Tools (17.11.5 October 8, 2024 version) bootstrapper. https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history
18
+ `
19
+ curl -SL --output vs_buildtools.exe https://download.visualstudio.microsoft.com/download/pr/69e24482-3b48-44d3-af65-51f866a08313/471c9a89fa8ba27d356748ae0cf25eb1f362184992dc0bb6e9ccf10178c43c27/vs_BuildTools.exe `
20
+ `
21
+ # Install Build Tools with the Microsoft.VisualStudio.Workload.VCTools recommended workload and ATL & ATLMFC, excluding some Windows SDKs.
22
+ `
23
+ && (start /w vs_buildtools.exe --quiet --wait --norestart --nocache `
24
+ --installPath "%VS_INSTALL_DIRECTORY%" `
25
+ --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended `
26
+ --add Microsoft.VisualStudio.Component.VC.ATL `
27
+ --add Microsoft.VisualStudio.Component.VC.ATLMFC `
28
+ --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
29
+ --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
30
+ --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
31
+ --remove Microsoft.VisualStudio.Component.Windows81SDK `
32
+ || IF "%ERRORLEVEL%" =="3010" EXIT 0) `
33
+ `
34
+ # Add VS's CMake to the system PATH and cleanup
35
+ `
36
+ && setx PATH "%PATH%;%VS_INSTALL_DIRECTORY%\C ommon7\I DE\C ommonExtensions\M icrosoft\C Make\C Make\b in" /M `
37
+ `
38
+ # Cleanup
39
+ `
40
+ && del /q vs_buildtools.exe
41
+
42
+ ENV VS_DEV_CMD_DIRECTORY="${VS_INSTALL_DIRECTORY}\C ommon7\T ools"
43
+
44
+ RUN `
45
+ # Add VS_DEV_CMD_DIRECTORY to the system PATH
46
+ `
47
+ setx PATH "%PATH%;%VS_DEV_CMD_DIRECTORY%" /M
48
+
49
+ RUN `
50
+ # Download VulkanSDK
51
+ `
52
+ curl -SL --output VulkanSDK-Installer.exe https://sdk.lunarg.com/sdk/download/1.3.268.0/windows/VulkanSDK-1.3.268.0-Installer.exe `
53
+ `
54
+ # Install VulkanSDK
55
+ `
56
+ && VulkanSDK-Installer.exe install --root "%VULKAN_SDK_INSTALL_DIRECTORY%" --default-answer --accept-licenses --confirm-command `
57
+ `
58
+ # Cleanup
59
+ `
60
+ && del /q VulkanSDK-Installer.exe
61
+
62
+ RUN `
63
+ # Download & install choco packet manager
64
+ `
65
+ powershell Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1' ))
66
+
67
+ RUN `
68
+ # Download & install executable Strawberry Perl
69
+ `
70
+ choco install -y strawberryperl --version 5.28.2.1
71
+
72
+ RUN `
73
+ # Download & install Python
74
+ `
75
+ choco install -y python --version 3.11.6
76
+
77
+ RUN `
78
+ # Download & install git
79
+ `
80
+ choco install -y git --version 2.43.0
81
+
82
+ RUN `
83
+ # Download & install nasm
84
+ `
85
+ choco install -y nasm --version 2.16.1
86
+
87
+ RUN `
88
+ # Download & install ninja
89
+ `
90
+ choco install -y ninja --version 1.12.1
91
+
92
+ RUN `
93
+ # Enable Long Paths feature
94
+ `
95
+ reg add "HKLM\S YSTEM\C urrentControlSet\C ontrol\F ileSystem" /v "LongPathsEnabled" /t REG_DWORD /d 1 /f
96
+
97
+ RUN `
98
+ # Force git to use HTTPS protocol & trust containers
99
+ `
100
+ git config --system protocol.*.allow always `
101
+ `
102
+ && git config --system url."https://github.com/" .insteadOf "git@github.com:" `
103
+ `
104
+ && git config --system --add safe.directory *
105
+
106
+ RUN `
107
+ # Post environment setup
108
+ `
109
+ setx VS_INSTALL_DIRECTORY "%VS_INSTALL_DIRECTORY%" /M `
110
+ `
111
+ && setx PATH "%PATH%;%VS_INSTALL_DIRECTORY%\V C\A uxiliary\B uild" /M `
112
+ `
113
+ && setx NBL_CI_MODE "ON"
114
+
115
+ WORKDIR ${THIS_PROJECT_NABLA_DIRECTORY}
116
+ ENTRYPOINT ["cmd.exe" , "/K" ]
0 commit comments