docker

Containerize .NET applications with multi-stage Docker builds and health checks.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/shahdanish/vibepos --skill docker-shahdanish
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker
Source: https://github.com/shahdanish/vibepos/tree/main/skills/docker
Command: npx skills add https://github.com/shahdanish/vibepos --skill docker-shahdanish

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the guesswork of containerizing .NET applications by providing proven Docker patterns for building, running, and operating containers reliably.

Core Features & Use Cases

  • Multi-stage Docker builds: Produces smaller runtime images by separating build and runtime stages.
  • Non-root container execution: Uses the built-in non-root user approach for safer production deployments.
  • Faster, cache-friendly builds: Restores dependencies using copied .csproj files before copying the full source.
  • Health checks and operational readiness: Adds container health checks and recommends matching health endpoints for Docker/Compose.
  • Common anti-pattern avoidance: Prevents oversized images and invalidates NuGet caches by copying/restore in the right order.

Quick Start

Ask the AI to generate a production-ready multi-stage Dockerfile for your .NET app with a non-root user and a Docker health check 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 smaller Docker image for my .NET application?

You can create smaller Docker images for .NET applications by using multi-stage builds that separate the build environment from the runtime environment. This approach prevents the final image from including unnecessary SDK files and build artifacts, resulting in a leaner production container.

What is the best way to run a .NET container as a non-root user?

Running a .NET container as a non-root user involves configuring the Dockerfile to use the built-in non-root user approach. This provides safer production deployments by ensuring the application process does not have administrative privileges inside the container.

Why does copying source code before restoring NuGet packages slow down Docker builds?

Copying source code before restoring NuGet packages invalidates the Docker build cache whenever any code changes. Restoring dependencies using copied .csproj files first ensures the restore step is cached and only runs when project references actually change.

How do I configure Docker health checks for a .NET Web API?

Configuring Docker health checks for a .NET Web API requires adding the HEALTHCHECK instruction to your Dockerfile and implementing a matching health endpoint in your application. This setup provides operational readiness monitoring for Docker and Docker Compose environments.

Can I use Docker Compose for local development of containerized .NET applications?

Yes, you can use Docker Compose for local development of containerized .NET applications. It supports managing Web API and worker scenarios, allowing you to define and run multi-container setups with production-ready health monitoring configurations.