Skip to content

Commit 5c964c9

Browse files
author
Patrick Stephens
committed
workflows: pull previous windows build to speed up
Signed-off-by: Patrick Stephens <[email protected]>
1 parent d786dde commit 5c964c9

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/workflows/call-build-images.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,26 @@ jobs:
401401
with:
402402
ref: ${{ inputs.ref }}
403403

404+
# - name: Set up Docker Buildx
405+
# uses: docker/setup-buildx-action@v3
406+
404407
- name: Log in to the Container registry
405408
uses: docker/login-action@v3
406409
with:
407410
registry: ${{ inputs.registry }}
408411
username: ${{ inputs.username }}
409412
password: ${{ secrets.token }}
410413

414+
- name: Pull the last release image to speed up the build with a cache
415+
continue-on-error: true
416+
run: |
417+
VERSION=$(gh release list --json tagName,isLatest --jq '.[] | select(.isLatest)|.tagName | sub("^v"; "")')
418+
echo VERSION="$VERSION"
419+
docker pull ${{ inputs.registry }}/${{ inputs.image }}:windows-${{ matrix.windows-base-version }}-$VERSION
420+
shell: bash
421+
env:
422+
GH_TOKEN: ${{ secrets.token }}
423+
411424
- name: Build the production images
412425
run: |
413426
docker build -t ${{ inputs.registry }}/${{ inputs.image }}:windows-${{ matrix.windows-base-version }}-${{ inputs.version }} --build-arg FLB_NIGHTLY_BUILD=${{ inputs.unstable }} --build-arg WINDOWS_VERSION=ltsc${{ matrix.windows-base-version }} -f ./dockerfiles/Dockerfile.windows .

dockerfiles/Dockerfile.windows

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
ARG 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

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

@@ -69,6 +69,8 @@ ENV VCPKG_LIBRARY_LINKAGE=static
6969
RUN vcpkg install --recurse openssl --triplet x64-windows-static; `
7070
vcpkg install --recurse libyaml --triplet x64-windows-static;
7171

72+
FROM builder-base AS builder
73+
7274
# Build Fluent Bit from source - context must be the root of the Git repo
7375
WORKDIR /src/build
7476
COPY . /src/
@@ -95,7 +97,8 @@ RUN New-Item -Path /fluent-bit/etc/ -ItemType "directory"; `
9597
Copy-Item -Path /src/conf/parsers_openstack.conf /fluent-bit/etc/; `
9698
Copy-Item -Path /src/conf/parsers_cinder.conf /fluent-bit/etc/; `
9799
Copy-Item -Path /src/conf/plugins.conf /fluent-bit/etc/; `
98-
Copy-Item -Path /src/build/bin/Release/fluent-bit.exe /fluent-bit/bin/; `
100+
Copy-Item -Path /src/build/bin/Release/fluent-bit.exe /fluent-bit/bin/
101+
99102
#
100103
# Runtime Image - Windows Server Core
101104
#

0 commit comments

Comments
 (0)