spec icon indicating copy to clipboard operation
spec copied to clipboard

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

Open joshspicer opened this issue 3 years ago • 1 comments

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 to modify the path variable, like so:

...
"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

joshspicer avatar Jun 12 '23 18:06 joshspicer

Somewhat related: https://github.com/devcontainers/spec/issues/19

joshspicer avatar Jun 20 '23 16:06 joshspicer