DevContainer/Feature/Reference
Dev Container Features reference
Quotes
Intro
- Development Container Features are self-contained, shareable units of installation code and development container configuration. The name comes from the idea that referencing one of them allows you to quickly and easily add more tooling, runtime, or library “features” into your development container for you or your collaborators to use.
- Feature metadata is captured by a
devcontainer-feature.jsonfile in the root folder of the feature. - Note: While Features may be installed on top of any base image, the implementation of a Feature might restrict it to a subset of possible base images. For example, some Features may be authored to work with a certain Linux distro (e.g. debian-based images that use the
aptpackage manager).
Folder Structure
devcontainer-feature.json properties
- The
devcontainer-feature.jsonfile defines metadata about a given Feature. - devContainerFeature.schema.json defines the schema for the
devcontainer-feature.jsonfile.
- The
User environment variables
- Feature scripts run as the
rootuser and sometimes need to know which user account the dev container will be used with. _REMOTE_USERand_CONTAINER_USERenvironment variables are passsed to the Features scripts with_CONTAINER_USERbeing the container’s user and_REMOTE_USERbeing the configuredremoteUser. If noremoteUseris configured,_REMOTE_USERis set to the same value as_CONTAINER_USER.
- Feature scripts run as the