本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)40k · #7117

containerize-aspnetcore

できること

このツールは、ASP.NET Core プロジェクトを「コンテナ」にするために必要な手順書(Dockerfile と呼ばれます)を作成します。コンテナは、アプリケーションの実行に必要なものをすべて詰め込んだ、隔離されたパッケージのようなもので、さまざまな環境へのデプロイを容易にします。

使う場面

  • ✓すべてを手動でインストールせずに、ASP.NET Core アプリケーションをサーバーで実行したいとき。
  • ✓Azure、AWS、Google Cloud などのクラウドへのデプロイに向けて準備するとき。
  • ✓どのコンピューターでも同じように動作することを確実にしたいとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/github/awesome-copilot/blob/main/skills/containerize-aspnetcore/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“'my-project/my-app.csproj' にある ASP.NET Core プロジェクトのコンテナを作成してください。.NET 8 と Alpine Linux ディストリビューションを使用してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、.NET のバージョンや希望する Linux の種類など、入力された設定を分析します。それに基づいて、アプリケーションのコンテナをビルドするための手順書である Dockerfile という名前のファイルを生成します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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. 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 application settings and connection strings can be read from environment variables
  • ✅ Dockerfile creation and configuration for an ASP.NET Core application
  • ✅ Specifying multiple stages in the Dockerfile to build/publish the application and copy the output to the final image
  • ✅ Configuration of Linux container platform compatibility (Alpine, Ubuntu, Chiseled, or Azure Linux (Mariner))

…

よくある質問

コンテナとは何ですか?

コンテナは、アプリケーションとその動作に必要なもの(コード、ライブラリ、設定など)を含む、標準化された箱のようなものだと考えてください。これにより、どこでも一貫して動作します。

Dockerfile とは何ですか?

Docker(コンテナ技術)がコンテナイメージをビルドする際に従う指示が書かれたテキストファイルです。アプリケーションのパッケージを作るためのレシピのようなものです。

このツールを使うのに Docker の知識は必要ですか?

いいえ。このツールが複雑な部分を隠してくれるので、プロジェクトの基本的な設定を指定するだけでコンテナを作成できます。

詳細

作者による元の説明

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

repo: github/awesome-copilot

人気

GitHubのスター
40k
ランキング
#7117
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル