Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 41 additions & 7 deletions .github/workflows/call-build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,22 +381,32 @@ jobs:

# This takes a long time...
call-build-windows-container:
name: Windows container images
name: Windows ${{ matrix.windows-container-type }} ${{ matrix.windows-base-version }} container image
runs-on: windows-${{ matrix.windows-base-version }}
environment: ${{ inputs.environment }}
needs:
- call-build-images-meta
strategy:
fail-fast: true
matrix:
windows-base-version:
- '2022'
- '2025'
include:
- windows-base-version: '2022'
windows-container-type: servercore
dockerfile: Dockerfile.windows
image-tag-prefix: windows-2022
- windows-base-version: '2025'
windows-container-type: servercore
dockerfile: Dockerfile.windows
image-tag-prefix: windows-2025
- windows-base-version: '2025'
windows-container-type: nanoserver
dockerfile: Dockerfile.windows.nano
image-tag-prefix: windows-nano-2025
Comment thread
cosmo0920 marked this conversation as resolved.
permissions:
contents: read
packages: write
env:
IMAGE: ${{ inputs.registry }}/${{ inputs.image }}:windows-${{ matrix.windows-base-version }}-${{ inputs.version }}
IMAGE: ${{ inputs.registry }}/${{ inputs.image }}:${{ matrix.image-tag-prefix }}-${{ inputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -438,21 +448,45 @@ jobs:
run: |
VERSION=$(gh release list --json tagName,isLatest --jq '.[] | select(.isLatest)|.tagName | sub("^v"; "")')
echo VERSION="$VERSION"
docker pull ${{ inputs.registry }}/${{ inputs.image }}:windows-${{ matrix.windows-base-version }}-$VERSION
docker pull ${{ inputs.registry }}/${{ inputs.image }}:${{ matrix.image-tag-prefix }}-$VERSION
shell: bash
env:
GH_TOKEN: ${{ secrets.token }}

- name: Build the production images
run: |
docker build -t $IMAGE --build-arg FLB_NIGHTLY_BUILD=${{ inputs.unstable }} --build-arg WINDOWS_VERSION=ltsc${{ matrix.windows-base-version }} -f ./dockerfiles/Dockerfile.windows .
docker build -t $IMAGE --build-arg FLB_NIGHTLY_BUILD=${{ inputs.unstable }} --build-arg WINDOWS_VERSION=ltsc${{ matrix.windows-base-version }} -f ./dockerfiles/${{ matrix.dockerfile }} .
shell: bash

- name: Sanity check of the production images
run: |
docker run --rm -t $IMAGE --help
shell: bash

- name: Sanity check the Nano Server default configuration
if: matrix.windows-container-type == 'nanoserver'
run: |
$containerName = "fluent-bit-nano-${{ matrix.windows-base-version }}"

try {
docker run --detach --name $containerName $env:IMAGE
Start-Sleep -Seconds 5

$running = docker inspect --format '{{.State.Running}}' $containerName
docker logs $containerName

if ($running -ne "true") {
throw "Nano Server container did not remain running"
}
}
finally {
$containerId = docker ps --all --quiet --filter "name=^/${containerName}$"
if ($containerId) {
docker rm --force $containerName | Out-Null
}
}
shell: pwsh

- name: Push the production images
if: inputs.push
run: |
Expand Down
48 changes: 41 additions & 7 deletions .github/workflows/pr-image-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths:
- 'dockerfiles/Dockerfile'
- 'dockerfiles/Dockerfile.windows'
- 'dockerfiles/Dockerfile.windows.nano'
- 'conf/**'

workflow_dispatch:
Expand Down Expand Up @@ -85,15 +86,24 @@ jobs:
DOCKER_BUILDKIT: 0
shell: bash
pr-image-tests-build-windows-images:
name: PR - Docker windows build test, windows 2022 and 2025
name: PR - Docker ${{ matrix.windows-container-type }} build, Windows ${{ matrix.windows-base-version }}
runs-on: windows-${{ matrix.windows-base-version }}
strategy:
fail-fast: true
matrix:
windows-base-version:
# https://github.com/fluent/fluent-bit/blob/1d366594a889624ec3003819fe18588aac3f17cd/dockerfiles/Dockerfile.windows#L3
- '2022'
- '2025'
include:
- windows-base-version: '2022'
windows-container-type: servercore
dockerfile: Dockerfile.windows
image-tag-suffix: windows-2022
- windows-base-version: '2025'
windows-container-type: servercore
dockerfile: Dockerfile.windows
image-tag-suffix: windows-2025
- windows-base-version: '2025'
windows-container-type: nanoserver
dockerfile: Dockerfile.windows.nano
image-tag-suffix: windows-nano-2025
permissions:
contents: read
steps:
Expand All @@ -108,7 +118,7 @@ jobs:
tags: |
type=sha
flavor: |
suffix=-windows-${{ matrix.windows-base-version }}
suffix=-${{ matrix.image-tag-suffix }}

# https://github.com/actions/runner-images/issues/12199
# https://github.com/moby/moby/issues/48093
Expand All @@ -133,11 +143,35 @@ jobs:
- name: Build the windows images
id: build
run: |
docker build -t ${{ steps.meta.outputs.tags }} --build-arg WINDOWS_VERSION=ltsc${{ matrix.windows-base-version }} -f ./dockerfiles/Dockerfile.windows .
docker build -t ${{ steps.meta.outputs.tags }} --build-arg WINDOWS_VERSION=ltsc${{ matrix.windows-base-version }} -f ./dockerfiles/${{ matrix.dockerfile }} .

- name: Sanity check it runs
# We do this for a simple check of dependencies
run: |
docker run --rm -t ${{ steps.meta.outputs.tags }} --help
shell: bash

- name: Sanity check the Nano Server default configuration
if: matrix.windows-container-type == 'nanoserver'
run: |
$containerName = "fluent-bit-nano-${{ matrix.windows-base-version }}"

try {
docker run --detach --name $containerName ${{ steps.meta.outputs.tags }}
Start-Sleep -Seconds 5

$running = docker inspect --format '{{.State.Running}}' $containerName
docker logs $containerName

if ($running -ne "true") {
throw "Nano Server container did not remain running"
}
}
finally {
$containerId = docker ps --all --quiet --filter "name=^/${containerName}$"
if ($containerId) {
docker rm --force $containerName | Out-Null
}
}
shell: pwsh
Comment thread
coderabbitai[bot] marked this conversation as resolved.

2 changes: 2 additions & 0 deletions .github/workflows/staging-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,8 @@ jobs:
runs_on: windows-latest
- tag: "windows-2025-${{ github.event.inputs.version }}"
runs_on: windows-2025
- tag: "windows-nano-2025-${{ github.event.inputs.version }}"
runs_on: windows-2025
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
Expand Down
19 changes: 19 additions & 0 deletions conf/fluent-bit-nano.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[SERVICE]
Flush 1
Daemon Off
Log_Level info
Parsers_File parsers.conf
Plugins_File plugins.conf
HTTP_Server Off
HTTP_Listen 0.0.0.0
HTTP_Port 2020
Storage.Metrics On

[INPUT]
Name forward
Listen 0.0.0.0
Port 24224

[OUTPUT]
Name stdout
Match *
5 changes: 3 additions & 2 deletions dockerfiles/Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
# - dockerfiles/Dockerfile.windows
#

ARG WINDOWS_SERVER_TYPE=servercore
ARG WINDOWS_VERSION=ltsc2025

# Builder Image - Windows Server Core
FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION AS builder-base
FROM mcr.microsoft.com/windows/$WINDOWS_SERVER_TYPE:$WINDOWS_VERSION AS builder-base

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

Expand Down Expand Up @@ -228,7 +229,7 @@ RUN New-Item -Path /fluent-bit/etc/ -ItemType "directory"; `
#
# Runtime Image - Windows Server Core
#
FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION AS runtime
FROM mcr.microsoft.com/windows/$WINDOWS_SERVER_TYPE:$WINDOWS_VERSION AS runtime

ARG FLUENTBIT_VERSION=master
ARG IMAGE_CREATE_DATE
Expand Down
Loading
Loading