一键导入
containerize-aspnetcore
Containerize an ASP.NET Core project by creating Dockerfile and .dockerfile files customized for the project.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Containerize an ASP.NET Core project by creating Dockerfile and .dockerfile files customized for the project.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | containerize-aspnetcore |
| description | Containerize an ASP.NET Core project by creating Dockerfile and .dockerfile files customized for the project. |
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. Follow best practices for containerizing .NET Core applications, ensuring that the container is optimized for performance, security, and maintainability.
[ProjectName (provide path to .csproj file)][8.0 or 9.0 (Default 8.0)][debian, alpine, ubuntu, chiseled, or Azure Linux (mariner) (Default debian)][e.g., 8080][User account, or default to "$APP_UID"][ASPNETCORE_URLS, or default to "http://+:8080"][Package names, or "None"][Library names and paths, or "None"][Tool names and versions, or "None"]TargetFramework element.dockerignore file excluding unnecessary filesdocker build -t aspnetcore-app:latest . to verifyFROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["YourProject/YourProject.csproj", "YourProject/"]
RUN dotnet restore "YourProject/YourProject.csproj"
COPY . .
WORKDIR "/src/YourProject"
RUN dotnet publish "YourProject.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim AS final
WORKDIR /app
ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
COPY --from=build /app/publish .
USER $APP_UID
ENTRYPOINT ["dotnet", "YourProject.dll"]
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS final
RUN apk update && apk add --no-cache curl ca-certificates
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled AS final
FROM mcr.microsoft.com/dotnet/aspnet:8.0-azurelinux3.0 AS final
RUN tdnf update -y && tdnf install -y curl ca-certificates && tdnf clean all
USER $APP_UID)latestEnforces approval guardrails for Azure operations. Unless an operation is pre-approved in a project allowlist, any command that deletes or modifies existing Azure resources or user accounts requires explicit user approval before execution. Activate whenever executing Azure operations via az CLI, azd, Azure PowerShell (Az module), Azure MCP tools, or Microsoft Graph — especially before any delete, update, set, remove, or identity-related command.
Validate NuGet package versions before adding or updating packages in .NET projects. Use when choosing a NuGet package version, checking package vulnerabilities, avoiding deprecated packages, auditing dotnet package list results, or requiring confirmation for packages not published in over one year.
Work with GitHub Advanced Security for Azure DevOps (GHAzDO): list and triage code/secret/dependency scanning alerts, dismiss (close) alerts, and associate alerts with work items. Use when the user asks about Advanced Security alerts, CodeQL findings, secret scanning, or dependency vulnerabilities in Azure Repos. REST-API-based — the Azure DevOps MCP Server has no Advanced Security tools.
Manage Azure Artifacts: list and create feeds, inspect package versions, promote packages between views, delete/unlist versions, and publish/download Universal Packages. Use when the user asks about Azure DevOps package feeds, NuGet/npm/Maven/Python/Universal packages, or feed views. REST/CLI-based — the Azure DevOps MCP Server has no Artifacts tools.
Manage Azure Boards work items: create, update fields, add comments, link items, and close them. Use when the user asks to create/update/comment on/close bugs, tasks, user stories, or other work items in Azure DevOps. Prefers Azure DevOps MCP Server tools and falls back to the REST API.
Shared foundation for all Azure DevOps skills: how to detect and configure the Azure DevOps MCP Server, and how to fall back to the REST API (Entra ID or PAT authentication) when MCP tools are unavailable. Read this before using any azure-devops-* skill.