Skip to content

Add lightweight Dockerized ASP.NET Core sample - #12

Merged
balajibashyam merged 4 commits into
mainfrom
feature/dockerized-aspnet-core-sample
Aug 3, 2026
Merged

Add lightweight Dockerized ASP.NET Core sample#12
balajibashyam merged 4 commits into
mainfrom
feature/dockerized-aspnet-core-sample

Conversation

@balajibashyam

Copy link
Copy Markdown
Contributor

Summary

Adds a minimal .NET 10 companion sample for the Dockerizing ASP.NET Core: Multi-Stage Builds, Clean Images & a Production-Ready Ship Workflow tutorial.

What's included

  • New sample: cloud-native/dockerize-aspnet-core-clean-images — 14 files

    • Multi-stage Dockerfile with separate restore and publish stages
    • Committed package lock files with --locked-mode restore
    • Runtime-only final image using mcr.microsoft.com/dotnet/aspnet:10.0-noble
    • Non-root execution via $APP_UID
    • Port 8080 with ASPNETCORE_HTTP_PORTS
    • Liveness, readiness, and combined health endpoints
    • .NET-based Docker health probe (ContainerHealthProbe)
    • Runtime configuration through Sample__Message
    • Read-only filesystem, dropped capabilities, no-new-privileges
    • Hardened compose.yaml
    • 5 xUnit v3 integration tests
  • Root README: New sample row in the table + updated repository structure

  • GitHub Actions: New test-dockerized-aspnet-core job in the shared workflow; path filters updated

Deliberately omitted (stays in the full tutorial)

Database, authentication, secrets, private feeds, build secrets, image publishing, cloud deployment, Kubernetes, multi-architecture builds, image signing, vulnerability scanning, fixed image-size targets, production restart policy.

Versions

  • .NET SDK: 10.0.302
  • Microsoft.AspNetCore.Mvc.Testing: 10.0.10
  • Microsoft.NET.Test.Sdk: 18.8.1
  • xunit.v3: 3.2.2
  • xunit.runner.visualstudio: 3.1.5

Validation

  • dotnet restore — passed
  • dotnet build --configuration Release — passed (0 errors, 0 warnings)
  • dotnet test --configuration Release — passed (5/5)
  • Docker image build — passed
  • Container health check — healthy
  • HTTP endpoints — all 200 OK
  • Non-root user — verified (UID 1654)
  • SDK absence in runtime — verified
  • Docker Compose config — valid
  • Docker Compose runtime — healthy, configuration override verified
  • Security scan — clean

@balajibashyam
balajibashyam merged commit 7bff194 into main Aug 3, 2026
14 checks passed
@balajibashyam
balajibashyam deleted the feature/dockerized-aspnet-core-sample branch August 3, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant