diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index f34bc248b2..80f57b4488 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -46,6 +46,16 @@ jobs: uses: ./.github/actions/validate-version with: version: ${{ env.MinVerVersion }} + - name: Determine runtime version + shell: pwsh + run: | + # Read settings from Custom.Build.props + [xml]$xml = Get-Content ./src/Custom.Build.props + $runtimeVersion = $xml.selectNodes('/Project/PropertyGroup/RuntimeFrameworkVersion').InnerText + if (-not ($runtimeVersion)) { + throw "Missing RuntimeFrameworkVersion setting in Custom.Build.props" + } + echo "RuntimeVersion=$runtimeVersion" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4.0.0 - name: Log in to GitHub container registry @@ -64,6 +74,8 @@ jobs: push: true platforms: linux/amd64,linux/arm64 sbom: true + build-args: | + RUNTIMEVERSION=${{ env.RuntimeVersion }} labels: | org.opencontainers.image.source=https://github.com/Particular/ServiceControl/tree/${{ github.sha }} org.opencontainers.image.authors="Particular Software" @@ -75,7 +87,7 @@ jobs: org.opencontainers.image.created=${{ steps.date.outputs.date }} org.opencontainers.image.title=${{ matrix.title }} org.opencontainers.image.description=${{ matrix.description }} - org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseled-composite-extra + org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/aspnet:${{ env.RuntimeVersion }}-noble-chiseled-composite-extra annotations: | index:org.opencontainers.image.source=https://github.com/Particular/ServiceControl/tree/${{ github.sha }} index:org.opencontainers.image.authors="Particular Software" @@ -87,6 +99,6 @@ jobs: index:org.opencontainers.image.created=${{ steps.date.outputs.date }} index:org.opencontainers.image.title=${{ matrix.title }} index:org.opencontainers.image.description=${{ matrix.description }} - index:org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseled-composite-extra + index:org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/aspnet:${{ env.RuntimeVersion }}-noble-chiseled-composite-extra file: src/${{ matrix.project }}/Dockerfile tags: ghcr.io/particular/${{ matrix.name }}:${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || env.MinVerVersion }} diff --git a/src/Custom.Build.props b/src/Custom.Build.props index d02fe0aef2..4e5c9f214f 100644 --- a/src/Custom.Build.props +++ b/src/Custom.Build.props @@ -13,6 +13,11 @@ true + + 10.0.9 + Disable + + 5.7 minor diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 66e8440f71..e47fe3014a 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -7,7 +7,7 @@ - + @@ -16,17 +16,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -72,25 +72,25 @@ - - - + + + - + - - + + - + - - - - + + + + diff --git a/src/ServiceControl.Audit/Dockerfile b/src/ServiceControl.Audit/Dockerfile index 410f789465..4dee310716 100644 --- a/src/ServiceControl.Audit/Dockerfile +++ b/src/ServiceControl.Audit/Dockerfile @@ -1,3 +1,5 @@ +ARG RUNTIMEVERSION=10.0 + # Build image FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build ARG TARGETARCH @@ -9,7 +11,7 @@ RUN dotnet build src/ServiceControl.Audit/ServiceControl.Audit.csproj --configur RUN dotnet publish src/HealthCheckApp/HealthCheckApp.csproj --arch $TARGETARCH --output /healthcheck # Runtime image -FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseled-composite-extra +FROM mcr.microsoft.com/dotnet/aspnet:$RUNTIMEVERSION-noble-chiseled-composite-extra WORKDIR /app EXPOSE 44444 diff --git a/src/ServiceControl.Config.Tests/ServiceControl.Config.Tests.csproj b/src/ServiceControl.Config.Tests/ServiceControl.Config.Tests.csproj index c85f515177..8bafc4ae31 100644 --- a/src/ServiceControl.Config.Tests/ServiceControl.Config.Tests.csproj +++ b/src/ServiceControl.Config.Tests/ServiceControl.Config.Tests.csproj @@ -6,6 +6,10 @@ true + + + + diff --git a/src/ServiceControl.Config/ServiceControl.Config.csproj b/src/ServiceControl.Config/ServiceControl.Config.csproj index 0b163009fe..23352f154e 100644 --- a/src/ServiceControl.Config/ServiceControl.Config.csproj +++ b/src/ServiceControl.Config/ServiceControl.Config.csproj @@ -15,6 +15,10 @@ win-x64 + + + + diff --git a/src/ServiceControl.Monitoring/Dockerfile b/src/ServiceControl.Monitoring/Dockerfile index f7fdaab4b0..4b9fe10087 100644 --- a/src/ServiceControl.Monitoring/Dockerfile +++ b/src/ServiceControl.Monitoring/Dockerfile @@ -1,3 +1,5 @@ +ARG RUNTIMEVERSION=10.0 + # Build image FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build ARG TARGETARCH @@ -9,7 +11,7 @@ RUN dotnet build src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj RUN dotnet publish src/HealthCheckApp/HealthCheckApp.csproj --arch $TARGETARCH --output /healthcheck # Runtime image -FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseled-composite-extra +FROM mcr.microsoft.com/dotnet/aspnet:$RUNTIMEVERSION-noble-chiseled-composite-extra WORKDIR /app EXPOSE 33633 diff --git a/src/ServiceControl/Dockerfile b/src/ServiceControl/Dockerfile index 0f2330052c..c50ffb8490 100644 --- a/src/ServiceControl/Dockerfile +++ b/src/ServiceControl/Dockerfile @@ -1,3 +1,5 @@ +ARG RUNTIMEVERSION=10.0 + # Build image FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build ARG TARGETARCH @@ -9,7 +11,7 @@ RUN dotnet build src/ServiceControl/ServiceControl.csproj --configuration Releas RUN dotnet publish src/HealthCheckApp/HealthCheckApp.csproj --arch $TARGETARCH --output /healthcheck # Runtime image -FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseled-composite-extra +FROM mcr.microsoft.com/dotnet/aspnet:$RUNTIMEVERSION-noble-chiseled-composite-extra WORKDIR /app EXPOSE 33333