Aller au contenu
Skillpedia
Déploiement et cloud (DevOps)40k · #7117

containerize-aspnetcore

Ce qu’il fait

Cet outil crée les instructions nécessaires (appelées Dockerfile) pour transformer votre projet ASP.NET Core en « conteneur ». Un conteneur est comme un paquet isolé qui regroupe tout ce dont votre application a besoin pour fonctionner, ce qui facilite son déploiement dans différents environnements.

Quand l’utiliser

  • ✓Lorsque vous voulez faire fonctionner votre application ASP.NET Core sur un serveur sans tout installer manuellement.
  • ✓Lorsque vous préparez votre application pour un déploiement dans le cloud (comme Azure, AWS ou Google Cloud).
  • ✓Si vous devez vous assurer que votre application fonctionne de la même façon sur n'importe quel ordinateur.

Lien du skill

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

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/github/awesome-copilot/blob/main/skills/containerize-aspnetcore/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Crée un conteneur pour mon projet ASP.NET Core situé dans le dossier « my-project/my-app.csproj », en utilisant .NET 8 et la distribution Alpine Linux.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'outil analyse les paramètres que vous indiquez, comme la version de .NET et le type de Linux souhaité. Sur cette base, il génère un fichier nommé Dockerfile, qui est un guide étape par étape pour construire le conteneur de votre application.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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))

…

Questions fréquentes

Qu'est-ce qu'un conteneur ?

Imaginez un conteneur comme une boîte standardisée qui contient votre application et tout ce dont elle a besoin pour fonctionner (code, bibliothèques, paramètres). Cela garantit qu'elle fonctionne de manière identique partout.

Qu'est-ce qu'un Dockerfile ?

C'est un fichier texte contenant des instructions que Docker (la technologie de conteneurs) suit pour créer l'image de votre conteneur. C'est une sorte de recette pour fabriquer le paquet de votre application.

Faut-il beaucoup connaître Docker pour utiliser cet outil ?

Non. Cet outil simplifie la complexité : il vous suffit d'indiquer les paramètres de base de votre projet pour créer le conteneur.

Détails

Description originale de l’auteur

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

repo: github/awesome-copilot

Popularité

Étoiles GitHub
40k
Position au classement
#7117
Licence
MIT
Mis à jour
15/10/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires