question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

  1. 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"
  }
}
  1. Rebuild and Reopen in Container
  2. 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:open
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chrmarticommented, Aug 6, 2020
0reactions
Tyriarcommented, Oct 12, 2021

If we did this we would not support "remoteEnv" in the devcontainer but we would want to support terminal.integrated.env and terminal profile env.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found