Skip to content

Codespaces Configuration with the Dev Container Editor

Adding a configuration for Codespaces involves adding a Development Container to a repository and editing it to meet your needs. Previously, a dev container configuration could either be written manually or created with a VS Code extension. We have now added the ability to create or edit a configuration directly from the Code drop down on a GitHub repository page.

Code dropdown showing the new Codespaces configuration option

Whether you use this mechanism, or you already have a dev container in your repository, you can now edit that configuration within GitHub using the new configuration editor. To open the editor from the code view in a repository, click the pencil icon while viewing a devcontainer.json file.

screenshot of view of devcontainer.json file

You are now editing the devcontainer.json file in place in the browser. The dev container needs to conform to the Development Container specification. The editor makes using dev container Features easy. Dev container Features provide reusable configurations for Codespaces created from the repository. Browse available features from right side of the dev container editor.

screenshot of editor and marketplace

To use a dev container feature, copy the snippet of json and place it in the features object of your devcontainer.json file. Once you have the features you want, commit those changes to the repository by clicking the "Start commit" button.

screenshot of the start commit button function

We hope this will make configuring your repositories for Codespaces significantly easier.

At GitHub, we strive to make it easier for developers to release the best version of their code to users. As a result, we've rolled out a new feature that allows you to explicitly set which release of your code is the latest.

Previously, a repository's latest release was the one created on the most recent date. In the event that multiple releases had the same date, the semantic version number broke the tie.

This new feature provides an explicit toggle to mark a release "latest" when you create it. This gives you more control over your code, and it works both in the web interface and through the API (GraphQL, REST).

Screenshot of setting to make a release the latest

Read more about releases in the GitHub documentation.

We appreciate feedback on this and other topics in the GitHub Community discussions.

See more

When you are building out a configuration for Codespaces using a dev container, the default behavior is now to do an incremental rebuild. The existing rebuild functionality is still available and has been renamed to ‘Full rebuild’.

Incremental rebuild is much faster because it builds on top of your existing docker cache, reusing common images and layers between rebuilds. This is readily apparent when adding configurations to the default container for Codespaces which is quite large.

When using VS Code, you access these commands from the command palette.

Rebuild commands in the command palette in Visual Studio Code!

The rebuild behavior prior to this change was full rebuild, which is slower but guarantees correctness because it removes all images from the virtual machine before re-pulling even unchanged images. You may occasionally want to do this after many iterations of rebuilding your configuration, and want to free up disk space or ensure your configuration is not dependent on layers that won’t be present during a clean creation of a codespace from the configuration.

See more