Skip to content

${containerEnv:ENV_VAR:default_value} not working #7121

@aeschli

Description

@aeschli

Testing #7100

  • open a new folder, create a new devcontainer file (e.g. Ubuntu)
  • add "postCreateCommand": "echo XXX ${localEnv:PATH:NO_PATH} ${localEnv:PATH1:NO_PATH1}",
  • run the container. Works
[5207 ms] Start: Run in container: /bin/sh -c echo XXX /home/aeschli/.local/bin:/home/aeschli/.... NO_PATH1
XXX /home/aeschli/.local/bin:/home/aeschli/... NO_PATH1

change localEnv to containerEnv:
"postCreateCommand": "echo XXX ${containerEnv:PATH:NO_PATH} ${containerEnv:PATH1:NO_PATH1}",

  • rebuild container
[5199 ms] Start: Run in container: /bin/sh -c echo XXX ${containerEnv:PATH:NO_PATH} ${containerEnv:PATH1:NO_PATH1}
/bin/sh: 1: Bad substitution

Metadata

Metadata

Assignees

Labels

candidateIssue identified as probable candidate for fixing in the next releasecontainersIssue in vscode-remote containersverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions