Closed jonfen closed 4 years ago
Hi, thanks for raising this issue.
First, I'll have to dig into devcontainers, to see how it works - I never had a chance to work with devcontainers. I'll then try to see what my extension needs to cover to work with devcontainers.
Related to #29
Hi, thanks for raising this issue.
First, I'll have to dig into devcontainers, to see how it works - I never had a chance to work with devcontainers. I'll then try to see what my extension needs to cover to work with devcontainers.
Let me know if I can help.
Working Examples: https://github.com/search?q=org%3Amicrosoft+vscode-remote-try-&type=Repositories Docs: https://code.visualstudio.com/docs/remote/containers
Hi @jonfen,
I dig it a little bit and I think using containerEnv
or remoteEnv
inside settings
is not supported by VSCode itself. I even tried to use ${env:ENV_VARIABLE}
with local workspace and that didn't work as well. I think it's related to this issue: https://github.com/microsoft/vscode/issues/2809 .
So unfortunately, I really cannot do anything to make it work the way you want to.
If you'll find any extension, which is working with referencing environment variables, please repoen this issue and link it here, so I'll dig it more :wink:
So that we don't commit a redmine API key to git, it is nice to leverage the .env option when using devcontainers with docker-compose.
https://code.visualstudio.com/docs/remote/containers-advanced#_option-2-use-an-env-file https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_variables-in-devcontainerjson
.env
docker-compose.vscode.yml
.devcontainer.json
Inside the container
echo $REDMINE_API_KEY
exports4asd9na345lkjnc9d8934n5
Hardcoding"redmine.apiKey": "4asd9na345lkjnc9d8934n5"
also works