codewithmukesh/dotnet-claude-kit/docker
Claude Code and agent skill by codewithmukesh/dotnet-claude-kit
- community
Checking that the SKILL.md file is still in the repository.
Docker containerization for .NET 10 applications. Covers multi-stage builds, .NET container images, non-root user configuration, health checks, and .dockerignore. Load this skill when containerizing an application with a Dockerfile, optimizing image size, setting up Docker Compose for local development, or when the user mentions "Docker", "Dockerfile", "container", "docker-compose", "image", "multi-stage", "non-root", ".dockerignore", or "container health check". For Dockerfile-less SDK publishing (`dotnet publish /t:PublishContainer`), load the container-publish skill instead.
Install
npx vskill@latest install codewithmukesh/dotnet-claude-kit/dockerSKILL.md
The same SKILL.md was published earlier as codewithmukesh/dotnet-claude-kit/docker.
Docker
Core Principles
- Multi-stage builds always — Separate build and runtime stages. Build in the SDK image, run in the ASP.NET runtime image.
- Non-root by default — .NET container images support
USER appby default since .NET 8. Never run as root in production. - Layer caching matters — Copy
.csprojfiles and restore before copying source code. This caches NuGet dependencies across builds. - Health probes at the orchestrator level — Expose a
/health/liveendpoint and let Kubernetes/Compose probe it. Chiseled and default aspnet images have no shell or curl, so in-imageHEALTHCHECKcommands have nothing to run with.
Patterns
Multi-Stage Dockerfile for Web API
Container Health Probes
Prefer orchestrator-level probes (Kubernetes livenessProbe, Compose healthcheck) over a Dockerfile HEALTHCHECK — the standard aspnet and chiseled images ship no shell, no curl, and no wget, so there is nothing inside the container to run the probe with. Point the orchestrator at /health/live:
If you must have an in-image HEALTHCHECK, base the runtime stage on a non-chiseled image that includes wget — never re-run the app binary as the probe command; that starts a second instance instead of checking the first.
.dockerignore
Docker Compose for Local Development
Key .NET-specific concerns — pass connection strings via environment, use depends_on with health checks:
Optimized Build with .slnx
For solutions with multiple projects, restore only the necessary projects.
Health Check Endpoint
Anti-patterns
Don't Use SDK Image for Runtime
Don't Copy Everything Before Restore
Don't Run as Root
Decision Guide
| Scenario | Recommendation | |
|---|---|---|
| Web API container | Multi-stage build with aspnet runtime image | |
| Worker service | Multi-stage build with dotnet/runtime image | |
| Local development | Docker Compose with service dependencies | |
| CI builds | Multi-stage build (self-contained) | |
| Image size optimization | Use Alpine variant + trimming for small images | |
| Health monitoring | /health endpoint + orchestrator probe (K8s httpGet / Compose healthcheck) | |
| Secrets | Environment variables or mounted secrets, never in image |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/docker/SKILL.md
Popularity
- Repository stars
- 655
- Repository forks
- 150
- 7-day trend score
- 32
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/codewithmukesh/dotnet-claude-kit/docker)