1414ARG WINDOWS_VERSION=ltsc2019
1515
1616# Builder Image - Windows Server Core
17- FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION AS builder
17+ FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION AS builder-base
1818
1919RUN setx /M PATH "%PATH%;C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\WinFlexBison;C:\dev\vcpkg"
2020
@@ -62,15 +62,29 @@ RUN `
6262 Rename-Item -Path /dev/vcpkg-${ENV:VCPKG_VERSION} -NewName vcpkg; `
6363 /dev/vcpkg/bootstrap-vcpkg.bat;
6464
65+ # Ensure we only attempt to build release and static linking
66+ ENV VCPKG_BUILD_TYPE=release
67+ ENV VCPKG_LIBRARY_LINKAGE=static
68+
6569RUN vcpkg install --recurse openssl --triplet x64-windows-static; `
6670 vcpkg install --recurse libyaml --triplet x64-windows-static;
6771
72+ FROM builder-base AS builder
73+
6874# Build Fluent Bit from source - context must be the root of the Git repo
6975WORKDIR /src/build
7076COPY . /src/
7177
7278ARG BUILD_PARALLEL=1
73- RUN cmake -G "'Visual Studio 16 2019'" -DOPENSSL_ROOT_DIR='C:\dev\vcpkg\packages\openssl_x64-windows-static' -DFLB_LIBYAML_DIR='C:\dev\vcpkg\packages\libyaml_x64-windows-static' -DCMAKE_BUILD_TYPE=Release ../;`
79+ RUN cmake -G "'Visual Studio 16 2019'" `
80+ -DOPENSSL_ROOT_DIR='C:\dev\vcpkg\packages\openssl_x64-windows-static' `
81+ -DFLB_LIBYAML_DIR='C:\dev\vcpkg\packages\libyaml_x64-windows-static' `
82+ -DCMAKE_BUILD_TYPE=Release `
83+ -DFLB_SHARED_LIB=Off `
84+ -DFLB_EXAMPLES=Off `
85+ -DFLB_DEBUG=Off `
86+ -DFLB_RELEASE=On `
87+ ../;`
7488 cmake --build . --config Release -j ${BUILD_PARALLEL};
7589
7690# Set up config files and binaries in single /fluent-bit hierarchy for easy copy in later stage
@@ -83,8 +97,8 @@ RUN New-Item -Path /fluent-bit/etc/ -ItemType "directory"; `
8397 Copy-Item -Path /src/conf/parsers_openstack.conf /fluent-bit/etc/; `
8498 Copy-Item -Path /src/conf/parsers_cinder.conf /fluent-bit/etc/; `
8599 Copy-Item -Path /src/conf/plugins.conf /fluent-bit/etc/; `
86- Copy-Item -Path /src/build/bin/Release/fluent-bit.exe /fluent-bit/bin/; `
87- Copy-Item -Path /src/build/bin/Release/fluent-bit.dll /fluent-bit/bin/;
100+ Copy-Item -Path /src/build/bin/Release/fluent-bit.exe /fluent-bit/bin/;
101+
88102#
89103# Runtime Image - Windows Server Core
90104#
0 commit comments