From 8d7fdb5f2e8d85c753cc353d4b5063283393f8e5 Mon Sep 17 00:00:00 2001 From: Ray Labbe Date: Tue, 17 Feb 2026 15:15:05 -0500 Subject: [PATCH 1/3] feat(sync): Updated docker/container support for .Net 10 --- KepwareSync.Service/Dockerfile | 26 +++++++++---------- .../Kepware.SyncService.csproj | 4 +-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/KepwareSync.Service/Dockerfile b/KepwareSync.Service/Dockerfile index 8fed29b..45dd640 100644 --- a/KepwareSync.Service/Dockerfile +++ b/KepwareSync.Service/Dockerfile @@ -1,19 +1,19 @@ -# Unter https://aka.ms/customizecontainer erfahren Sie, wie Sie Ihren Debugcontainer anpassen und wie Visual Studio dieses Dockerfile verwendet, um Ihre Images für ein schnelleres Debuggen zu erstellen. +# Learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging at https://aka.ms/customizecontainer -# Diese ARGs ermöglichen den Austausch der Basis, die zum Erstellen des endgültigen Images beim Debuggen von VS verwendet wird. +# These ARGs allow switching the base used to create the final image when debugging from VS. ARG LAUNCHING_FROM_VS -# Hiermit wird das Basisimage für "final" festgelegt, jedoch nur, wenn LAUNCHING_FROM_VS definiert wurde. +# This sets the base image for 'final', but only if LAUNCHING_FROM_VS is defined. ARG FINAL_BASE_IMAGE=${LAUNCHING_FROM_VS:+aotdebug} -# Diese Stufe wird verwendet, wenn sie von VS im Schnellmodus ausgeführt wird (Standardeinstellung für Debugkonfiguration). -FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base +# This stage is used when running from VS in Fast mode (Default for Debug configuration). +FROM mcr.microsoft.com/dotnet/runtime:10.0 AS base USER $APP_UID WORKDIR /app -# Diese Stufe wird zum Erstellen des Dienstprojekts verwendet. -FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build -# Installieren Sie clang/zlib1g-dev-Abhängigkeiten für die Veröffentlichung unter nativ +# This stage is used to build the service project. +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +# Install clang/zlib1g-dev dependencies for native AOT publishing RUN apt-get update \ && apt-get install -y --no-install-recommends \ clang zlib1g-dev @@ -27,22 +27,22 @@ COPY . . WORKDIR "/src/KepwareSync.Service" RUN dotnet build "./Kepware.SyncService.csproj" -c $BUILD_CONFIGURATION -o /app/build -# Diese Stufe wird verwendet, um das Dienstprojekt zu veröffentlichen, das in die letzte Phase kopiert werden soll. +# This stage is used to publish the service project to be copied to the final stage. FROM build AS publish ARG BUILD_CONFIGURATION=Release RUN dotnet publish "./Kepware.SyncService.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=true -# Diese Stufe wird als Basis für die letzte Stufe verwendet, wenn sie von VS gestartet wird, um das Debuggen im regulären Modus zu unterstützen (Standardwert, wenn die Debugkonfiguration nicht verwendet wird). +# This stage is used as the base for the final stage when launched from VS to support debugging in regular mode (Default when not using Debug configuration). FROM base AS aotdebug USER root -# Installieren Sie GDB, um natives Debuggen zu unterstützen. +# Install GDB to support native debugging. RUN apt-get update \ && apt-get install -y --no-install-recommends \ gdb USER app -# Diese Stufe wird in der Produktion oder bei Ausführung von VS im regulären Modus verwendet (Standard, wenn die Debugkonfiguration nicht verwendet wird). -FROM ${FINAL_BASE_IMAGE:-mcr.microsoft.com/dotnet/runtime-deps:9.0} AS final +# This stage is used in production or when running from VS in regular mode (Default when not using Debug configuration). +FROM ${FINAL_BASE_IMAGE:-mcr.microsoft.com/dotnet/runtime-deps:10.0} AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["./Kepware.SyncService"] \ No newline at end of file diff --git a/KepwareSync.Service/Kepware.SyncService.csproj b/KepwareSync.Service/Kepware.SyncService.csproj index f497583..8662113 100644 --- a/KepwareSync.Service/Kepware.SyncService.csproj +++ b/KepwareSync.Service/Kepware.SyncService.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 enable Kepware-SyncService-26c7b057-7b28-4930-aade-96e5e6829984 enable @@ -31,7 +31,7 @@ - + From 3ad36dc25b6e433e5e619038056d3df8ededc5e4 Mon Sep 17 00:00:00 2001 From: Ray Labbe Date: Tue, 17 Feb 2026 15:45:50 -0500 Subject: [PATCH 2/3] fix: Workflow to always check container build if sync service is updated --- .github/workflows/docker-build-and-push.yml | 27 ++++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-build-and-push.yml b/.github/workflows/docker-build-and-push.yml index 19d4f8f..e457326 100644 --- a/.github/workflows/docker-build-and-push.yml +++ b/.github/workflows/docker-build-and-push.yml @@ -3,18 +3,18 @@ name: Container Image on: workflow_dispatch: workflow_run: - branches: [ "main" ] + branches: [ "*" ] workflows: ["Sync Service Build and Release"] types: - completed - push: - branches: - - main - paths: - # - 'Kepware.Api/**' - - 'KepwareSync.Service/**' - # - '.github/workflows/docker-build-and-push.yml' - - '!**/*.md' # Exclude markdown files + # push: + # branches: + # - main + # paths: + # - 'Kepware.Api/**' + # - 'KepwareSync.Service/**' + # - '.github/workflows/docker-build-and-push.yml' + # - '!**/*.md' Exclude markdown files jobs: build: @@ -50,7 +50,16 @@ jobs: id: lowercase run: echo "REPO_OWNER_LOWER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + - name: Build and export to Docker + uses: docker/build-push-action@v6 + with: + load: true + tags: kepware-sync-service:test + - name: Test + run: | + docker run --rm kepware-sync-service:test - name: Build and push Docker image + if: ${{ github.event_name != 'pull_request'}} id: docker_build uses: docker/build-push-action@v4 with: From a116f9827348f4e6407fd045ea3ffe623d519bbc Mon Sep 17 00:00:00 2001 From: Ray Labbe Date: Tue, 17 Feb 2026 15:45:50 -0500 Subject: [PATCH 3/3] fix: Workflow to always check container build if sync service is updated --- .github/workflows/docker-build-and-push.yml | 27 ++++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-build-and-push.yml b/.github/workflows/docker-build-and-push.yml index 19d4f8f..65ec90a 100644 --- a/.github/workflows/docker-build-and-push.yml +++ b/.github/workflows/docker-build-and-push.yml @@ -3,18 +3,18 @@ name: Container Image on: workflow_dispatch: workflow_run: - branches: [ "main" ] + branches: [ "main", "**" ] workflows: ["Sync Service Build and Release"] types: - completed - push: - branches: - - main - paths: - # - 'Kepware.Api/**' - - 'KepwareSync.Service/**' - # - '.github/workflows/docker-build-and-push.yml' - - '!**/*.md' # Exclude markdown files + # push: + # branches: + # - main + # paths: + # - 'Kepware.Api/**' + # - 'KepwareSync.Service/**' + # - '.github/workflows/docker-build-and-push.yml' + # - '!**/*.md' Exclude markdown files jobs: build: @@ -50,7 +50,16 @@ jobs: id: lowercase run: echo "REPO_OWNER_LOWER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + - name: Build and export to Docker + uses: docker/build-push-action@v6 + with: + load: true + tags: kepware-sync-service:test + - name: Test + run: | + docker run --rm kepware-sync-service:test - name: Build and push Docker image + if: ${{ github.event_name != 'pull_request'}} id: docker_build uses: docker/build-push-action@v4 with: