Allow blocked environment variables through if they're included explicitly in terminal launch configs
See original GitHub issue- VSCode Version: 1.47.1 (not insider as I can’t get docker builds working on that for some reason)
- Local OS Version: Windows 10 2004
- Remote OS Version: WSL2 Ubuntu 20.04
- Remote Extension/Connection Type: Docker Desktop using WSL2 backend
Steps to Reproduce:
- Create a new project with a single file:
# .devcontainer/devcontainer.json
{
"image": "alpine:latest",
"remoteEnv": {
"GOOGLE_API_KEY": "api-key",
"GOOGLE_SOMETHING_ELSE": "something-else"
}
}
- Rebuild and Reopen in Container
- In the remote terminal, check the environment for variables:
$ printenv | grep GOOGLE
Expected outcome:
GOOGLE_API_KEY=api-key
GOOGLE_SOMETHING_ELSE=something-else
Actual outcome:
GOOGLE_SOMETHING_ELSE=something-else
This is the same no matter the base image used. Changing the name of GOOGLE_API_KEY
to anything else, even by a single character, allows it through.
Does this issue occur when you try this locally?: Not relevant as this is a remote container build Does this issue occur when you try this locally and all extensions are disabled?: Not relevant as this is a remote container build
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Environment variables in Compose | Docker Documentation
Your configuration options can contain environment variables. Compose uses the variable values from the shell environment in which docker-compose is run.
Read more >Use environment variables | Cloud Run Documentation
When you set environment variables, they are injected into the container and are accessible to your code. Environment variables are set as key/value...
Read more >cmd - Is there a command to refresh environment variables ...
The script handles the use case of changing environment variables globally in "My Computer...Environment Variables", but if an environment variable is changed ...
Read more >4. The Shell Startup Files - Using csh & tcsh [Book] - O'Reilly
Its behavior is affected by your working environment, which includes: Terminal settings, such as your backspace and line kill characters. Variable values.
Read more >Environment Variables in Windows/macOS/Linux
To set (or change) a environment variable, use command " set varname=value ". There shall be no spaces before and after the '='...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Introduced for https://github.com/microsoft/vscode/issues/32213.
If we did this we would not support
"remoteEnv"
in the devcontainer but we would want to supportterminal.integrated.env
and terminal profileenv
.