Installing GitHub Copilot in dev containers

As an admin, you can install the GitHub Copilot extension to enable AI-powered code suggestions, and chat assistance within your dev container.

Before you begin

You must have performed the following tasks:
  • Gained access to edit the .devopsconfig control repository.
  • Have a valid GitHub account with an active GitHub Copilot subscription.

About this task

This task describes how you can configure a dev container to support GitHub Copilot, and install and activate the extension within the running environment.

Procedure

  1. Configure the dev container image:
    1. Navigate to the .devopsconfig Control repository.
    2. Edit the existing devcontainer.json file (for example, within the Java dev container configuration), and update the image property to define the specific container version:
      "image": "baravich/devcontainer-java-copilot:2.0.000" 
    3. Commit and push the changes to the repository.
  2. Launch the dev container:
    1. In Code, locate the appropriate tile for the dev container configured in Step 1.
    2. Click the tile to launch the dev container.
  3. Install the Copilot Extensions:
    1. You must run a script to install the necessary binaries once the environment is running. Open a new Terminal in the dev container environment.
    2. Copy and paste the following command to download and run the installation script:
      curl -fsSL https://raw.githubusercontent.com/sunpix/howto-install-copilot-in-code-server/refs/heads/main/install-copilot.sh

      This script automatically installs both the GitHub Copilot and Copilot Chat extensions.

  4. Authenticate and access the Copilot:
    1. Locate the GitHub Copilot icon in the activity bar or status bar, once the installation is complete.
    2. Select the icon and follow the prompts to sign in to your GitHub account.
    3. Authorize the extension to access your subscription.

Results

The GitHub Copilot and Chat extensions are now installed and active. You can now use AI assistance for code generation and technical questions directly within your development environment.