Skip to content

Commit c3d1280

Browse files
cosmo0920edsiper
authored andcommitted
dockerfiles: windows: Update to use vcpkg instead of chocolatey
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent f27a884 commit c3d1280

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

dockerfiles/Dockerfile.windows

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ARG WINDOWS_VERSION=ltsc2019
1616
# Builder Image - Windows Server Core
1717
FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION as builder
1818

19-
RUN setx /M PATH "%PATH%;C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\WinFlexBison"
19+
RUN setx /M PATH "%PATH%;C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\WinFlexBison;C:\dev\vcpkg"
2020

2121
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
2222
WORKDIR /local
@@ -49,18 +49,27 @@ RUN Start-Process /local/vc_redist.x64.exe -ArgumentList '/install', '/quiet', '
4949
Copy-Item -Path /Windows/System32/vccorlib140.dll -Destination /fluent-bit/bin/; `
5050
Copy-Item -Path /Windows/System32/vcruntime140.dll -Destination /fluent-bit/bin/;
5151

52-
# Install Chocolatey and OpenSSL: https://github.com/StefanScherer/dockerfiles-windows/blob/main/openssl/Dockerfile
53-
ENV chocolateyUseWindowsCompression false
54-
ENV chocolateyVersion '1.4.0'
55-
RUN iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')); `
56-
choco feature disable --name showDownloadProgress ; `
57-
choco install -y openssl;
52+
ENV VCPKG_VERSION=2024.05.24
53+
# https://github.com/microsoft/vcpkg/blob/2024.05.24/scripts/bootstrap.ps1
54+
ENV VCPKG_ROOT=/dev/vcpkg
55+
56+
WORKDIR /dev
57+
58+
RUN `
59+
Invoke-WebRequest -OutFile /dev/vcpkg.zip https://github.com/microsoft/vcpkg/archive/refs/tags/${ENV:VCPKG_VERSION}.zip; `
60+
Expand-Archive /dev/vcpkg.zip -Destination /dev; `
61+
Remove-Item -Force /dev/vcpkg.zip; `
62+
Rename-Item -Path /dev/vcpkg-${ENV:VCPKG_VERSION} -NewName vcpkg; `
63+
/dev/vcpkg/bootstrap-vcpkg.bat;
64+
65+
RUN vcpkg install --recurse openssl --triplet x64-windows-static; `
66+
vcpkg install --recurse libyaml --triplet x64-windows-static;
5867

5968
# Build Fluent Bit from source - context must be the root of the Git repo
6069
WORKDIR /src/build
6170
COPY . /src/
6271

63-
RUN cmake -G "'Visual Studio 16 2019'" -DOPENSSL_ROOT_DIR='C:\Program Files\OpenSSL-Win64\lib\VC\x64\MT' -DOPENSSL_INCLUDE_DIR='C:\Program Files\OpenSSL-Win64\include' -DCMAKE_BUILD_TYPE=Release ../;`
72+
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 ../;`
6473
cmake --build . --config Release;
6574

6675
# Set up config files and binaries in single /fluent-bit hierarchy for easy copy in later stage

0 commit comments

Comments
 (0)