microsoft / microsoft/vscode-remote-release
Support using config variables in devcontainer.json
Nobody has claimed this yet.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
I would like to be able to refer to a custom value specified in settings.json inside the devcontainer.json.
For example, if I have the following as an entry in my user-level settings.json:
"my.data_dir": "X:/"
I would like to be able to have:
"mounts": [
"src=${localConfig:my.data_dir},dst=/mnt/data,type=bind"
]
It should be possible to use this in build.args or runArgs or anywhere else that variables are currently supported. This would allow each user to put these files in a different path.
Current workaround is to put the value in the environment instead and use ${localEnv:MY_DATA} but this seems less elegant as it pollutes all other apps on the system.
This suggestion is intended to mirror ${localConfig:x} to ${config:x} in tasks.json/launch.json similar to how ${localEnv:x} mirrors ${env:x}.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing variable expansion used by devcontainer.json, especially ${localEnv}, and how values from settings.json are read. Review the requested mounts example along with build.args and runArgs; done means a user-level setting can be referenced consistently wherever variables are currently supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, vscode
- Domain
- developer-experience, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100