docker

Generate multi-stage Dockerfiles and Compose patterns for .NET 10 applications.

1|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/Trossitec/dotnet-claude-kit --skill docker-trossitec
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker
Source: https://github.com/Trossitec/dotnet-claude-kit/tree/main/skills/docker
Command: npx skills add https://github.com/Trossitec/dotnet-claude-kit --skill docker-trossitec

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of producing working, secure, and small Docker images for .NET 10 applications that behave reliably in local development and production.

Core Features & Use Cases

  • Multi-stage build guidance: Ensures SDK build stages and lightweight runtime stages are separated to reduce image size.
  • Non-root production defaults: Configures containers to run with the built-in non-root user to improve security.
  • Faster, cache-friendly Dockerfiles: Copies project files and restores dependencies before copying the full source to maximize layer caching.
  • Operational readiness: Adds container health checks and aligns them with lightweight health endpoints for orchestration and Compose.
  • .dockerignore optimization: Prevents build-context bloat and avoids unnecessary files from invalidating builds.

Quick Start

Ask the AI to generate a production-ready multi-stage Dockerfile and .dockerignore for my .NET 10 Web API, using a non-root runtime user and adding a health check that calls my /health/live endpoint.

Frequently Asked Questions about docker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a production-ready multi-stage Dockerfile for a .NET 10 app?

To create a multi-stage Dockerfile for .NET 10, separate the SDK build environment from the lightweight runtime environment. This approach minimizes final image size by compiling source code in an initial stage and copying only published outputs to the runtime stage.

How do I configure a .NET Docker container to run as a non-root user?

Configuring a .NET Docker container to run as a non-root user involves setting the built-in non-root user in your Dockerfile runtime stage. This security configuration ensures the application process executes without administrative privileges inside the container.

How do I optimize Docker layer caching for .NET applications?

Optimizing Docker layer caching for .NET applications requires copying project files and restoring dependencies before copying the full source code. This Dockerfile pattern prevents unnecessary package restore executions when only application source files change.

How do I add a HEALTHCHECK to a .NET Docker Compose deployment?

Adding a HEALTHCHECK to a .NET Docker Compose deployment requires wiring a container health check to a lightweight application endpoint. This configuration enables orchestration tools to monitor application readiness and manage dependencies based on health status.

Why does my .NET Docker build context include unnecessary files?

When a .NET Docker build context includes unnecessary files, optimizing the .dockerignore file prevents build-context bloat. This minimization step stops local artifacts and source directories from invalidating Docker layer caches during the build process.

Does Docker Compose work with .NET 10 local orchestration workflows?

Docker Compose works with .NET 10 local orchestration workflows by defining multi-container environments. It uses health-based dependencies to ensure your .NET application starts only after required services pass their configured health checks.