Skip to content

← Week 17 | Overview | Week 19 →

Week 18 - Dockerfiles for .NET

Phase 5: Containers (Weeks 17-20)

  • Done

Goal: Build small, fast and safe images for your apps.

Exercises:

  • Write a multi-stage Dockerfile using the official mcr.microsoft.com/dotnet sdk and aspnet images.
  • Optimise layer caching (copy csproj and restore first), add .dockerignore, run as the non-root app user.
  • Add a HEALTHCHECK and an environment-based configuration.
  • Compare image sizes: sdk base, aspnet, alpine, chiseled.

Deliverable: Dockerfile for your Blazor app with the image size before and after optimisation.

My notes: week-18-notes.md


← Week 17 | Overview | Week 19 →