devcontainers / devcontainers/spec

[Proposal] Introduce `path` property in `devcontainer-feature.json`

Open
#251 1 comment 5 reactions 0 assignees View on GitHub
proposal
Dominant language
No language data
Stars
5.7k
Forks
496
PR merge metrics
No merged PRs in 30d

Description

The $PATH variable is often modified by Features during installation to make a certain tool/script/etc easily accessible from the command line. A common pattern today is to use [`containerEnv`](https://containers.dev/implementors/features/#devcontainer-feature-json-properties) to modify the path variable, like so:

```jsonc
...
"containerEnv": {
"PATH": "/home/vscode/dotnet":${PATH}"
}
...
```

Adding a property `path` to the `devcontainer-feature.json` would provide a declarative way for indicate what a Feature author intends to be available at the end. Doing so this way would also limit pollution of the PATH variable by allowing the CLI an easy way to dedupe.

## Proposal

| Property | Type | Description |
|----------|------|-------------|
| `path` | `array` | An array of strings, each an absolute path that should be injected as a member of the $PATH variable. |

ref: https://github.com/devcontainers/spec/pull/234#discussion_r1218563819

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.