Features are self-contained units of installation code and dev container configuration, designed to work across a wide range of base container images. You can use features to quickly add tools, runtimes, or libraries to your codespace image. For more information, see the available features and features specification on the Development Containers website.
You can add features to a devcontainer.json
file from VS Code or from your repository on GitHub. Use the tabs in this article to display instructions for each of these ways of adding features.
Adding features to a devcontainer.json
file
Note
To add features in VS Code while you are working locally, and not connected to a codespace, you must have the "Dev Containers" extension installed and enabled. For more information about this extension, see the VS Code Marketplace.
-
Access the VS Code Command Palette with Shift+Command+P (Mac) or Ctrl+Shift+P (Windows/Linux).
-
Start typing "add dev" then click Codespaces: Add Dev Container Configuration Files.
-
Click Modify your active configuration.
-
Update your feature selections, then click OK.
-
If you're working in a codespace, a prompt will appear in the lower-right corner. To rebuild the container and apply the changes to the codespace you're working in, click Rebuild Now.