
Containerize Aspnetcore
Generate a Linux-optimized Dockerfile and .dockerignore for an ASP.NET Core app so you can ship the same .csproj to Docker without guessing base images or distro choices.
Overview
Containerize ASP.NET Core is an agent skill for the Ship phase that creates Dockerfile and .dockerignore files tailored to a specific ASP.NET Core project for Linux containers.
Install
npx skills add https://github.com/github/awesome-copilot --skill containerize-aspnetcoreWhat is this skill?
- Walks through settings-driven Dockerfile generation scoped to Linux-only container changes for a named .csproj
- Supports .NET 8.0 or 9.0 with selectable Linux bases: debian, alpine, ubuntu, chiseled, or Azure Linux (mariner), defaul
- Defaults unspecified options using documented [square-bracket] placeholders so you only fill what your project needs
- Emphasizes performance, security, and maintainability aligned with .NET container best practices
- Configurable Linux distros: debian, alpine, ubuntu, chiseled, Azure Linux (mariner)
- Targets .NET 8.0 or 9.0 (default 8.0)
- Settings use [square-bracket] defaults when fields are omitted
Adoption & trust: 8.5k installs on skills.sh; 34.6k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have a working ASP.NET Core service but no reliable, distro-aware Docker recipe that matches your .NET version and deployment target.
Who is it for?
Indie builders containerizing a single .csproj for the first time or standardizing images across environments before registry deploy.
Skip if: Teams that only need Windows containers, already maintain a locked enterprise base-image standard with no agent edits, or want full Kubernetes/compose orchestration beyond image creation.
When should I use this skill?
You need to containerize an ASP.NET Core (.NET) project for Linux Docker with Dockerfile and ignore files driven by explicit containerization settings.
What do I get? / Deliverables
You get project-specific container files optimized for Linux with chosen .NET and base-image settings, ready to build and push as part of your release pipeline.
- Project-tailored Dockerfile for Linux
- .dockerignore aligned to the ASP.NET Core layout
- Documented default vs custom containerization settings
Recommended Skills
Journey fit
Containerization is the bridge between a built .NET app and runnable deploy artifacts, which sits in Ship when you are preparing to release rather than still implementing features. Launch prep under Ship is where solo builders turn a local solution into images they can push to a registry and run in staging or production.
How it compares
Use this focused Dockerfile generator instead of generic “dockerize my app” chat that ignores .NET distro and SDK image conventions.
Common Questions / FAQ
Who is containerize-aspnetcore for?
Solo and small-team .NET developers shipping ASP.NET Core APIs or web apps who want agent-guided Linux Dockerfiles tied to their actual .csproj and framework version.
When should I use containerize-aspnetcore?
Use it in Ship during launch prep when you need a Dockerfile before CI/CD, staging on Azure Container Apps or AKS, or aligning local `docker build` with production Linux images.
Is containerize-aspnetcore safe to install?
Review the skill source and the Security Audits panel on this Prism page before letting an agent write container files that may alter build context or expose secrets in ENV layers.
SKILL.md
READMESKILL.md - Containerize Aspnetcore
# ASP.NET Core Docker Containerization Prompt ## Containerization Request Containerize the ASP.NET Core (.NET) project specified in the settings below, focusing **exclusively** on changes required for the application to run in a Linux Docker container. Containerization should consider all settings specified here. Abide by best practices for containerizing .NET Core applications, ensuring that the container is optimized for performance, security, and maintainability. ## Containerization Settings This section of the prompt contains the specific settings and configurations required for containerizing the ASP.NET Core application. Prior to running this prompt, ensure that the settings are filled out with the necessary information. Note that in many cases, only the first few settings are required. Later settings can be left as defaults if they do not apply to the project being containerized. Any settings that are not specified will be set to default values. The default values are provided in `[square brackets]`. ### Basic Project Information 1. Project to containerize: - `[ProjectName (provide path to .csproj file)]` 2. .NET version to use: - `[8.0 or 9.0 (Default 8.0)]` 3. Linux distribution to use: - `[debian, alpine, ubuntu, chiseled, or Azure Linux (mariner) (Default debian)]` 4. Custom base image for the build stage of the Docker image ("None" to use standard Microsoft base image): - `[Specify base image to use for build stage (Default None)]` 5. Custom base image for the run stage of the Docker image ("None" to use standard Microsoft base image): - `[Specify base image to use for run stage (Default None)]` ### Container Configuration 1. Ports that must be exposed in the container image: - Primary HTTP port: `[e.g., 8080]` - Additional ports: `[List any additional ports, or "None"]` 2. User account the container should run as: - `[User account, or default to "$APP_UID"]` 3. Application URL configuration: - `[Specify ASPNETCORE_URLS, or default to "http://+:8080"]` ### Build configuration 1. Custom build steps that must be performed before building the container image: - `[List any specific build steps, or "None"]` 2. Custom build steps that must be performed after building the container image: - `[List any specific build steps, or "None"]` 3. NuGet package sources that must be configured: - `[List any private NuGet feeds with authentication details, or "None"]` ### Dependencies 1. System packages that must be installed in the container image: - `[Package names for the chosen Linux distribution, or "None"]` 2. Native libraries that must be copied to the container image: - `[Library names and paths, or "None"]` 3. Additional .NET tools that must be installed: - `[Tool names and versions, or "None"]` ### System Configuration 1. Environment variables that must be set in the container image: - `[Variable names and values, or "Use defaults"]` ### File System 1. Files/directories that need to be copied to the container image: - `[Paths relative to project root, or "None"]` - Target location in container: `[Container paths, or "Not applicable"]` 2. Files/directories to exclude from containerization: - `[Paths to exclude, or "None"]` 3. Volume mount points that should be configured: - `[Volume paths for persistent data, or "None"]` ### .dockerignore Configuration 1. Patterns to include in the `.dockerignore` file (.dockerignore will already have common defaults; these are additional patterns): - Additional patterns: `[List any additional patterns, or "None"]` ### Health Check Configuration 1. Health check endpoint: - `[Health check URL path, or "None"]` 2. Health check interval and timeout: - `[Interval and timeout values, or "Use defaults"]` ### Additional Instructions 1. Ot