What problem does it solve?
Docker containerization for .NET 10 applications can be error-prone and inefficient when builds are slow, images are oversized, and containers run with insecure permissions.
Core Features & Use Cases
- Multi-stage Docker builds: Use separate build and runtime stages to reduce image size and improve build efficiency.
- Non-root containers by default: Configure the runtime image to run as a non-root user for better security.
- Health checks and orchestration readiness: Add HEALTHCHECK and align local orchestration (e.g., Docker Compose) with service health dependencies.
- .dockerignore best practices: Exclude common directories and files (like git, build outputs, node modules) to prevent bloated build contexts.
- Use-case fit: Containerize Web APIs or worker services, optimize Dockerfile layers for caching, and set up local development via Docker Compose.
Quick Start
Create a multi-stage Dockerfile that restores via copied .csproj files, publishes with dotnet publish, runs on the ASP.NET runtime image as a non-root user, and adds a HEALTHCHECK endpoint for /health/live.