Edit

Share via


Quickstart: Containerize your project by using GitHub Copilot modernization

In this quickstart, you containerize your project by using GitHub Copilot modernization.

To use container compute services like Azure Kubernetes Service and Azure Container Apps, you need to containerize your project by creating a Dockerfile and other related configuration files, and build container images. The GitHub Copilot modernization extension automates this containerization process.

Prerequisites

Containerize your project

Use the following steps to start the containerization process:

  1. Make sure you have Docker installed and running.

  2. In Visual Studio Code, open your migrated project.

  3. In the Activity sidebar, open the GitHub Copilot modernization extension pane.

  4. In the Tasks section, open Containerize Tasks and select Containerize Application.

    Screenshot of Visual Studio Code that shows the Containerize Application task with the Run Task button highlighted.

  5. After you select the task, the Copilot chat window with Agent Mode opens automatically.

  6. Select Continue repeatedly to confirm each tool action in the Copilot Chat window. The Copilot Agent uses various tools to facilitate containerization. Each tool's usage requires confirmation by selecting Continue.

  7. Copilot typically goes through the following steps to containerize your project:

    • Checks that Docker is installed and running.
    • Checks that the application code is ready to run in a container.
    • Creates a Dockerfile for each project.
    • Builds Docker images for each project.
    • Creates a summary of the containerization results.

Note

We recommend using Claude Sonnet 4 or later models for the best results.

It might take Copilot a few iterations to correct containerization errors.

Customize with your own prompts

The Containerize Application button sends a predefined prompt. For more control, type a custom prompt directly in the Copilot chat with Agent mode. This approach lets you specify containerization preferences for your project.

Tip

Example prompts for different scenarios:

  • "Containerize my application using a multi-stage Dockerfile to minimize the final image size" - optimize for production image size.
  • "Create a Dockerfile for my project using Eclipse Temurin 21 as the base image" - specify a particular base image.
  • "Containerize all modules in this multi-module project and create a docker-compose.yml for local testing" - handle multi-module projects with compose.
  • "Containerize my app and push the image to my Azure Container Registry: <acr-name>.azurecr.io" - build and push in one step.

See also