@@ -18,9 +18,10 @@ FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION AS builder-base
18
18
19
19
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
20
20
21
- # Install Visual Studio Build Tools 2019
21
+ # Install Visual Studio Build Tools 2019 (MSVS_VERSION=16) / 2022 (MSVS_VERSION=17, requires WINDOWS_VERSION=ltsc2022)
22
22
WORKDIR /local
23
- ENV MSVS_BUILD_TOOLS_VERSION="16" `
23
+ ARG MSVS_VERSION="16"
24
+ ENV MSVS_BUILD_TOOLS_VERSION="$MSVS_VERSION" `
24
25
MSVS_BUILD_TOOLS_DOWNLOAD_URL="https://aka.ms/vs" `
25
26
MSVS_HOME="C:\BuildTools"
26
27
RUN $msvs_build_tools_dist_name=\"vs_buildtools.exe\"; `
@@ -43,17 +44,6 @@ RUN $msvs_build_tools_dist_name=\"vs_buildtools.exe\"; `
43
44
'--includeRecommended' -NoNewWindow -Wait; `
44
45
Remove-Item -Force \"${msvs_build_tools_dist}\";
45
46
46
- ENV MSVC_RUNTIME_VERSION="15" `
47
- MSVC_RUNTIME_DOWNLOAD_URL="https://aka.ms/vs"
48
- RUN $msvc_runtime_dist_name=\"vc_redist.x64.exe\"; `
49
- $msvc_runtime_dist=\"${env:TMP}\${msvc_runtime_dist_name}\"; `
50
- $msvc_runtime_url=\"${env:MSVC_RUNTIME_DOWNLOAD_URL}/${env:MSVC_RUNTIME_VERSION}/release/${msvc_runtime_dist_name}\"; `
51
- Write-Host \"Downloading Microsoft Visual C++ Redistributable...\"; `
52
- Write-Host \"${msvc_runtime_url} -> ${msvc_runtime_dist}\"; `
53
- Invoke-WebRequest -OutFile \"${msvc_runtime_dist}\" \"${msvc_runtime_url}\"; `
54
- Write-Host \"Installing Microsoft Visual C++ runtime libraries...\"; `
55
- Start-Process \"${msvc_runtime_dist}\" -ArgumentList '/install', '/quiet', '/norestart' -NoNewWindow -Wait; `
56
- Remove-Item -Force \"${msvc_runtime_dist}\";
57
47
58
48
ENV CMAKE_HOME="C:\cmake"
59
49
ARG CMAKE_VERSION="3.31.6"
@@ -164,17 +154,22 @@ WORKDIR /src/build
164
154
COPY . /src/
165
155
166
156
ARG BUILD_PARALLEL=1
167
- RUN cmake -G "'Visual Studio 16 2019'" `
157
+ SHELL ["cmd", "/S", "/C"]
158
+ RUN call "%MSVS_HOME%\VC\Auxiliary\Build\vcvars64.bat" && `
159
+ cmake -G "NMake Makefiles" `
168
160
-DOPENSSL_ROOT_DIR='C:\dev\vcpkg\packages\openssl_x64-windows-static' `
169
161
-DFLB_LIBYAML_DIR='C:\dev\vcpkg\packages\libyaml_x64-windows-static' `
170
162
-DCMAKE_BUILD_TYPE=Release `
171
163
-DFLB_SHARED_LIB=Off `
172
164
-DFLB_EXAMPLES=Off `
173
165
-DFLB_DEBUG=Off `
174
166
-DFLB_RELEASE=On `
175
- ../; `
176
- cmake --build . --config Release -j ${ BUILD_PARALLEL};
167
+ ..\ && `
168
+ cmake --build . --config Release -j "% BUILD_PARALLEL%"
177
169
170
+ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
171
+
172
+ WORKDIR /fluent-bit/bin
178
173
# Set up config files and binaries in single /fluent-bit hierarchy for easy copy in later stage
179
174
RUN New-Item -Path /fluent-bit/etc/ -ItemType "directory"; `
180
175
Copy-Item -Path /src/conf/fluent-bit-win32.conf /fluent-bit/etc/fluent-bit.conf; `
@@ -185,7 +180,7 @@ RUN New-Item -Path /fluent-bit/etc/ -ItemType "directory"; `
185
180
Copy-Item -Path /src/conf/parsers_openstack.conf /fluent-bit/etc/; `
186
181
Copy-Item -Path /src/conf/parsers_cinder.conf /fluent-bit/etc/; `
187
182
Copy-Item -Path /src/conf/plugins.conf /fluent-bit/etc/; `
188
- Copy-Item -Path /src/build/bin/Release/ fluent-bit.exe /fluent-bit/bin/;
183
+ Copy-Item -Path /src/build/bin/fluent-bit.exe /fluent-bit/bin/;
189
184
190
185
#
191
186
# Runtime Image - Windows Server Core
0 commit comments