When using environment variables in a devcontainer.json
file, you can now include a default value that will be used when the environment variable is not set:
{
"image": "ubuntu:latest",
"remoteEnv": {
"MY_LOCAL_VAR": "${localEnv:MY_VAR:my_local_default}",
"MY_CONTAINER_VAR": "${containerEnv:MY_VAR:my_container_default}"
}
}
The built-in CLI devcontainer
(or devcontainer-insiders
for VS Code Insiders) of the Remote - Containers extension now forwards to the built-in open source CLI. The open
command and the previous CLI arguments for the build
command are also supported.
As part of the dev container specification, we recently open sourced two new repos, where we host a specific set of features and images that were previously in the vscode-dev-containers repository:
You could always publish your own dev container image, and now you can publish Features as well! To get started, you can use this Features template repository to create a set of Features. It includes a GitHub Actions workflow to automate the publishing process.
If you'd like your contributions to appear in the VS Code or GitHub Codespaces UI for dev container creation, you can do the following:
- Go to devcontainers.github.io
- Open a PR to modify the collection-index.yml file.
We expect the general model for distributing templates to be the same as Features - so stay tuned.
For more details on the process, you can review the announcement issue.