Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)40k · #7116

containerize-aspnet-framework

Skill này làm gì

Công cụ này tạo các hướng dẫn cần thiết (gọi là Dockerfile) để biến một dự án ASP.NET .NET Framework thành container. Nhờ đó, ứng dụng của bạn có thể chạy nhất quán ở bất kỳ đâu.

Khi nào nên dùng

  • ✓Khi bạn muốn chạy ứng dụng ASP.NET trên một máy chủ khác.
  • ✓Khi chuẩn bị ứng dụng để triển khai lên đám mây.
  • ✓Để đảm bảo ứng dụng hoạt động giống nhau trên các môi trường kiểm thử khác nhau.

Liên kết skill

https://github.com/github/awesome-copilot/blob/main/skills/containerize-aspnet-framework/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/containerize-aspnet-framework/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Đóng gói dự án ASP.NET của tôi nằm tại 'C:\myproject\myproject.csproj', dùng Windows Server 2022 Core và mở cổng 80.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ phân tích các thiết lập bạn cung cấp, như đường dẫn dự án và cổng. Sau đó, nó tạo tệp Dockerfile chứa mọi lệnh cần thiết để build và chạy ứng dụng trong một môi trường biệt lập (container).

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

  1. Project to containerize:

    • [ProjectName (provide path to .csproj file)]
  2. Windows Server SKU to use:

    • [Windows Server Core (Default) or Windows Server Full]
  3. Windows Server version to use:

    • [2022, 2019, or 2016 (Default 2022)]
  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., 80]
    • Additional ports: [List any additional ports, or "None"]
  2. User account the container should run as:

    • [User account, or default to "ContainerUser"]
  3. IIS settings that must be configured in the container image:

    • [List any specific IIS settings, or "None"]

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"]

Dependencies

  1. .NET assemblies that should be registered in the GAC in the container image:

    • [Assembly name and version, or "None"]
  2. MSIs that must be copied to the container image and installed:

    • [MSI names and versions, or "None"]
  3. COM components that must be registered in the container image:

    • [COM component names, or "None"]

System Configuration

  1. Registry keys and values that must be added to the container image:

    • [Registry paths and values, or "None"]
  2. Environment variables that must be set in the container image:

    • [Variable names and values, or "Use defaults"]
  3. Windows Server roles and features that must be installed in the container image:

    • [Role/feature names, or "None"]

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"]

.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. Other instructions that must be followed to containerize the project:

    • [Specific requirements, or "None"]
  2. 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)

…

Câu hỏi thường gặp

Container là gì?

Container giống như một hộp nhẹ, biệt lập chứa mọi thứ ứng dụng cần để chạy: mã, thư viện và thiết lập. Điều này đảm bảo nó hoạt động giống nhau trên mọi máy tính.

Khác biệt giữa .NET Framework và .NET Core là gì?

.NET Framework là phiên bản cũ hơn, thường dùng trên Windows. .NET Core (nay chỉ gọi là .NET) hiện đại hơn, đa nền tảng và linh hoạt hơn. Công cụ này dành riêng cho .NET Framework.

Tôi có cần cài đặt gì trước không?

Có, dự án cần cài gói NuGet 'Microsoft.Configuration.ConfigurationBuilders.Environment'. Nếu chưa có, bạn cần cài thủ công trong Visual Studio trước khi dùng công cụ này.

Chi tiết

Mô tả gốc của tác giả

Containerize an ASP.NET .NET Framework project by creating Dockerfile and .dockerfile files customized for the project.

repo: github/awesome-copilot

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7116
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự