fix(build): target .NET 8 in the Docker build to match the projects - #127
Merged
Conversation
The Docker build has failed on every run since the projects moved to net8.0 (d48988f, 2026-02-12). The Dockerfile still pinned the .NET 6 base images it was given in 2024-03-31, so the SDK 6 image could not build a net8.0 project: error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. [/src/SW.Mtm.Web/SW.Mtm.Web.csproj] That is why no chart or image has been published since 6.0.9 (Feb 2026) — `ci` fails, so `deploy` and `tag` never run. Reproduced locally byte-for-byte against the CI log before changing anything. - Dockerfile: aspnet 6.0 -> 8.0, sdk 6.0 -> 8.0 (match TargetFramework). - Dockerfile: copy SW.Mtm.MsSql.csproj into the pre-restore layer. It is a ProjectReference of SW.Mtm.Web but was never copied, so restore logged "Skipping project ... because it was not found" and the layer resolved an incomplete graph. Now 0 skip warnings. - ci-cd.yml: dotnet-version 6.0.x -> 8.0.x. Currently masked — there is no global.json, so the runner's newest preinstalled SDK is selected and the nuget job passes anyway — but the pin contradicts the projects and would break the moment a global.json is added. NOT bumping to 9.0 (Dependabot #117/#118). Verified empirically: sdk:9.0 + aspnet:9.0 BUILDS successfully and then fails at startup with "You must install or update .NET to run this application. Framework: 'Microsoft.NETCore.App', version '8.0.0'" — .NET roll-forward does not cross major versions by default. Those PRs would ship a green build and a crash-looping image. They should be closed, or the projects retargeted to net9.0 first. Verified: build fails before / succeeds after; the resulting image starts under the .NET 8 runtime and reaches application code (it then fails only on database connectivity, with no database configured locally). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VHkpqv6dB6wjALyFe9ocMU
|
Warning Review limit reachedNext included review available in 19 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: simplify9/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
MusaMisto
added a commit
that referenced
this pull request
Aug 31, 2026
Regression from the .NET 8 base-image bump (#127). The runtime images changed their default listening port between majors: aspnet:6.0 ASPNETCORE_URLS=http://+:80 -> listens on 80 aspnet:8.0 ASPNETCORE_HTTP_PORTS=8080 -> listens on 8080 The chart hardcodes containerPort 80 and the Service targets the named "http" port, so after the bump the app listened on 8080, the Service had no reachable endpoint, and the gateway answered 503 from envoy. It failed silently: the chart ships probes.enabled=false, so with no readiness probe the pod still reported 1/1 Ready while serving nothing. Deployment, Service, EndpointSlice, HTTPRoute and TLS all looked correct -- only an actual request over the wire showed it. Setting ASPNETCORE_HTTP_PORTS=80 restores the 6.0 behaviour exactly, so the chart, the Service and all six releases keep working with no chart change. It stays overridable per-deployment. Verified A/B against a real PostgreSQL, no port env override, exactly as the cluster runs them: ghcr.io/simplify9/mtm:8.0.2 curl :80 -> connection reset (nothing bound) this build curl :80 -> HTTP 404 (app responding) Claude-Session: https://claude.ai/code/session_01VHkpqv6dB6wjALyFe9ocMU Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
The projects moved to
net8.0on 2026-02-12 (d48988f). The Dockerfile still pinned the .NET 6 base images it was last given on 2024-03-31. SDK 6 cannot build anet8.0project:This is not new. The
CI/CD Pipelineworkflow has no successful run onmainin its entire visible history — every run back to 2026-06-25 failed.cifails, sodeployandtagnever run, which is exactly why nothing has been published since tag6.0.9(Feb 2026) and why the chart oncharts.sf9.iois still6.0.8.Reproduced locally byte-for-byte against the CI log before changing anything.
Changes (3 lines)
Dockerfileaspnet:6.0→8.0,sdk:6.0→8.0— matchTargetFrameworkDockerfileSW.Mtm.MsSql.csprojinto the pre-restore layerci-cd.ymldotnet-version: '6.0.x'→'8.0.x'SW.Mtm.MsSqlis aProjectReferenceofSW.Mtm.Webbut its csproj was never copied, so restore loggedSkipping project "/src/SW.Mtm.MsSql/SW.Mtm.MsSql.csproj" because it was not foundand resolved an incomplete graph in that layer. Now 0 skip warnings.The
ci-cd.ymlline is currently masked — there is noglobal.json, so the runner picks its newest preinstalled SDK and thenugetjob passes despite the6.0.xpin (confirmed:nugetsucceeded in the same run wherecifailed). It is corrected because it contradicts the projects and breaks the moment aglobal.jsonappears.I tested that exact combination. It is worse than the current failure, because it passes CI:
.NET roll-forward does not cross major versions by default, so
aspnet:9.0cannot run anet8.0app. Those PRs would ship a green build and a crash-looping image. Close them, or retarget the projects tonet9.0first and bump both images together.Verification
docker buildsucceeds after the change.docker runon the resulting image: Serilog initialises and EF Core executes — the app reaches application code and fails only on database connectivity, with no database configured locally. No framework-resolution error.Skipping projectwarnings in the restore layer.actionlintclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01VHkpqv6dB6wjALyFe9ocMU