containerize-aspnet-framework
它能做什么
这个工具会生成把 ASP.NET .NET Framework 项目变成容器所需的指令(称为 Dockerfile)。这样你的应用就能在任何地方保持一致地运行。
适用场景
- ✓当你想在另一台服务器上运行你的 ASP.NET 应用时。
- ✓当你准备把应用部署到云端时。
- ✓为了确保你的应用在不同的测试环境中表现一致。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/containerize-aspnet-framework/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我为位于 'C:\myproject\myproject.csproj' 的 ASP.NET 项目创建容器,使用 Windows Server 2022 Core,并暴露端口 80。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会分析你提供的设置,比如项目路径和端口。然后它会生成一个名为 Dockerfile 的文件,其中包含在隔离环境(容器)中构建和运行你的应用所需的全部命令。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
ASP.NET .NET Framework Containerization Prompt
Containerize the ASP.NET (.NET Framework) project specified in the containerization settings below, focusing exclusively on changes required for the application to run in a Windows Docker container. Containerization should consider all settings specified here.
REMEMBER: This is a .NET Framework application, not .NET Core. The containerization process will be different from that of a .NET Core application.
Containerization Settings
This section of the prompt contains the specific settings and configurations required for containerizing the ASP.NET (.NET Framework) 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
Project to containerize:
[ProjectName (provide path to .csproj file)]
Windows Server SKU to use:
[Windows Server Core (Default) or Windows Server Full]
Windows Server version to use:
[2022, 2019, or 2016 (Default 2022)]
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)]
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
Ports that must be exposed in the container image:
- Primary HTTP port:
[e.g., 80] - Additional ports:
[List any additional ports, or "None"]
- Primary HTTP port:
User account the container should run as:
[User account, or default to "ContainerUser"]
IIS settings that must be configured in the container image:
[List any specific IIS settings, or "None"]
Build configuration
Custom build steps that must be performed before building the container image:
[List any specific build steps, or "None"]
Custom build steps that must be performed after building the container image:
[List any specific build steps, or "None"]
Dependencies
.NET assemblies that should be registered in the GAC in the container image:
[Assembly name and version, or "None"]
MSIs that must be copied to the container image and installed:
[MSI names and versions, or "None"]
COM components that must be registered in the container image:
[COM component names, or "None"]
System Configuration
Registry keys and values that must be added to the container image:
[Registry paths and values, or "None"]
Environment variables that must be set in the container image:
[Variable names and values, or "Use defaults"]
Windows Server roles and features that must be installed in the container image:
[Role/feature names, or "None"]
File System
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"]
Files/directories to exclude from containerization:
[Paths to exclude, or "None"]
.dockerignore Configuration
- Patterns to include in the
.dockerignorefile (.dockerignore will already have common defaults; these are additional patterns):- Additional patterns:
[List any additional patterns, or "None"]
- Additional patterns:
Health Check Configuration
Health check endpoint:
[Health check URL path, or "None"]
Health check interval and timeout:
[Interval and timeout values, or "Use defaults"]
Additional Instructions
Other instructions that must be followed to containerize the project:
[Specific requirements, or "None"]
Known issues to address:
[Describe any known issues, or "None"]
Scope
- ✅ App configuration modification to ensure config builders are used to read app settings and connection strings from the environment variables
- ✅ Dockerfile creation and configuration for an ASP.NET application
- ✅ Specifying multiple stages in the Dockerfile to build/publish the application and copy the output to the final image
- ✅ Configuration of Windows container platform compatibility (Windows Server Core or Full)
…
常见问题
什么是容器?
容器就像一个轻量级的隔离盒子,里面装着应用运行所需的一切:代码、库和设置。这样无论在哪台电脑上,它的运行方式都一样。
.NET Framework 和 .NET Core 有什么区别?
.NET Framework 是较旧的版本,通常用于 Windows 系统。.NET Core(现在就叫 .NET)更现代、跨平台且更灵活。这个工具专门针对 .NET Framework。
使用前需要先安装什么吗?
需要。项目必须已安装 NuGet 包 'Microsoft.Configuration.ConfigurationBuilders.Environment'。如果没有安装,你需要在使用这个工具之前,先在 Visual Studio 中手动安装它。
详情
作者的原始描述
Containerize an ASP.NET .NET Framework project by creating Dockerfile and .dockerfile files customized for the project.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7116
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。