What problem does it solve?
This Skill provides best practices and techniques for containerizing .NET applications, ensuring efficient, secure, and minimal Docker images.
Core Features & Use Cases
- Multi-Stage Dockerfiles: Optimize image size and security by separating build and runtime environments.
dotnet publish Container Images: Leverage built-in .NET 8+ functionality for direct container image creation.
- Rootless Containers: Enhance security by running containers as non-root users.
- Base Image Selection: Guidance on choosing the most appropriate .NET base images (e.g., chiseled, alpine).
- Container Optimization: Strategies for layer caching,
.dockerignore, and memory management.
- Use Case: You need to deploy a .NET 8 ASP.NET Core API to a containerized environment. This Skill will guide you through creating an optimized, secure Dockerfile or using
dotnet publish to generate the image, ensuring it runs as a non-root user.
Quick Start
Create a multi-stage Dockerfile for a .NET 8 application following best practices for layer caching and minimal runtime image.