Skip to content

Conversation

@mabrarov
Copy link
Contributor

@mabrarov mabrarov commented Apr 7, 2025

This PR is based on (includes) #10178 and provides workaround for #10158 by using NMake (instead of MSBuild) when building Fluent Bit as part of building image for Windows Containers.

Changes (excluding #10178):

  • Building with NMake in image for Windows Containers.
  • Configurable version of MS Visual C++ used to build Fluent Bit within building of image for Windows Containers.
  • Removed unused DLLs (MS Visual C++ runtime libraries) from image for Windows Containers.

Testing

  • [N/A] Example configuration file for the change
  • [N/A] Debug log output from testing the change
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found
  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • [N/A] Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@mabrarov mabrarov force-pushed the feature/windows_container_nmake branch from 372305f to da875e4 Compare April 7, 2025 01:25
@mabrarov mabrarov changed the title Windows Containers image Fluent Bit NMake build dockerfile: Windows Containers image Fluent Bit NMake build Apr 7, 2025
@mabrarov mabrarov force-pushed the feature/windows_container_nmake branch from da875e4 to 70467a4 Compare April 8, 2025 06:02
@mabrarov mabrarov force-pushed the feature/windows_container_nmake branch from 70467a4 to 22fa55e Compare April 8, 2025 07:08
…to ensure no build issue due to incompatibility with new CMake versions.

Signed-off-by: Marat Abrarov <[email protected]>
…ported one for Linux containers.

Signed-off-by: Marat Abrarov <[email protected]>
Signed-off-by: Marat Abrarov <[email protected]>
…t Bit within building of image for Windows Containers.

Signed-off-by: Marat Abrarov <[email protected]>
@edsiper
Copy link
Member

edsiper commented Apr 21, 2025

note: I found some conflicts, I tried to fix them manually ...

@edsiper edsiper merged commit ebc19e6 into fluent:master Apr 21, 2025
23 checks passed
@edsiper edsiper added this to the Fluent Bit v4.0.1 milestone Apr 21, 2025
@mabrarov
Copy link
Contributor Author

Hi @edsiper,

I'm not sure if it was intentional, but this pull request was merged partially. Please check #10233 which includes missed changes.

Thank you.

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# Install Visual Studio Build Tools 2019
# Install Visual Studio Build Tools 2019 (MSVS_VERSION=16) / 2022 (MSVS_VERSION=17, requires WINDOWS_VERSION=ltsc2022)
Copy link
Contributor Author

@mabrarov mabrarov Jun 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSVS_VERSION=17 (Visual Studio Build Tools 2022) can be used even with WINDOWS_VERSION=ltsc2019:

$ docker build -t fluent/fluent-bit --build-arg MSVS_VERSION=17 -f dockerfiles/Dockerfile.windows .
...
Downloading Visual Studio Build Tools...
https://aka.ms/vs/17/release/vs_buildtools.exe -> C:\Users\ContainerAdministrator\AppData\Local\Temp\vs_buildtools.exe
https://aka.ms/vs/17/release/channel -> C:\local\VisualStudio.chman
Installing Visual Studio Build Tools into C:\BuildTools...
...
Successfully tagged fluent/fluent-bit:latest
$ docker run --rm fluent/fluent-bit --version
Fluent Bit v4.0.4
...
$ docker run --rm --entrypoint cmd fluent/fluent-bit
Microsoft Windows [Version 10.0.17763.678]
(c) 2018 Microsoft Corporation. All rights reserved.
...

Moreover, GitHub actions for this repository use windows-latest runner (including test execution for pull requests) which hosts Visual Studio 2022. It means that CI/CD builds Fluent Bit for Windows on Windows Server 2022 using Visual C++ 2022, except Docker image for Windows.

Visual Studio 2022 supports Windows Server 2019 - refer to https://learn.microsoft.com/en-us/visualstudio/releases/2022/system-requirements#supported-operating-systems.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this comment in #10233

nourdouf pushed a commit to seveas/fluent-bit that referenced this pull request Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants