Dotnet Dockerfile
Generates optimized .NET Core Dockerfiles for seamless application deployment and consistent environments across development & production.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add dotnet-dockerfile npx -- -y @trustedskills/dotnet-dockerfile
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"dotnet-dockerfile": {
"command": "npx",
"args": [
"-y",
"@trustedskills/dotnet-dockerfile"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill generates optimized, multi-stage Dockerfiles for .NET applications. It determines the appropriate .NET version (8, 9, or 10) and project type (ASP.NET Core web app, API, worker service, or console app), then creates a Dockerfile tailored to your application's needs. You can choose between standard, "chiseled" (smaller image size), or Native AOT (smallest/fastest startup) optimization options for deployment. Note that .NET 10 uses Ubuntu as the default Linux distribution.
When to use it
- Creating Docker images for ASP.NET Core web applications, APIs, worker services, and console apps.
- Generating production-ready Dockerfiles with a smaller footprint using "chiseled" or Native AOT optimizations.
- Ensuring consistent environments across development, testing, and production deployments.
- Deploying .NET applications to containerized environments like Azure.
Key capabilities
- Automatically determines the .NET version (8, 9, or 10).
- Supports ASP.NET Core web apps, APIs, worker services, and console app project types.
- Generates multi-stage Dockerfiles for optimized image size and performance.
- Offers optimization choices: standard, chiseled, and Native AOT.
- Handles multi-project solutions by copying multiple .csproj files during the restore phase.
- Supports self-contained deployments which bundle the .NET runtime with the application.
Example prompts
- "Generate a Dockerfile for my ASP.NET Core web app project located at src/MyApp/MyApp.csproj."
- "Create a chiseled Dockerfile for my API project, using .NET 9."
- "Generate a self-contained Dockerfile for my console application."
Tips & gotchas
- The skill requires the location of your project file (e.g.,
src/MyApp/MyApp.csproj). - .NET 10 uses Ubuntu as the default Linux distribution, replacing previous Debian images.
- "Chiseled" images are recommended for production environments due to their smaller size and security benefits (no shell or package manager, non-root user).
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.