devcontainers从WSL2开始,看不到环境变量
在运行 code.
的 WSL2 (Ubuntu) shell 中启动最新版本的 VSCode 时,然后重建/重新打开 .devcontainer.json
- 无法识别主机环境变量。
这是一个非常基本的 .devcontainer.json
,没有真正定义任何其他内容(变量方面),并且它具有 mounts
部分。
这确实不工作:
"mounts": [
"source=${localEnv:HOME}/.m2/,target=/home/vscode/.m2/,type=bind,consistency=cached",
],
这有效...
"mounts": [
"source=/home/johndoe/.m2/,target=/home/vscode/.m2/,type=bind,consistency=cached",
],
看起来这是最近在 VSCode 中修复的问题,但我仍然无法让它工作。
When starting the latest version of VSCode within a WSL2 (Ubuntu) shell running code .
, then rebuilding/reopening a .devcontainer.json
- the host environment variables are not recognized.
It is a pretty basic .devcontainer.json
, nothing else is really being defined (variable-wise) and it has the mounts
section.
This does not work:
"mounts": [
"source=${localEnv:HOME}/.m2/,target=/home/vscode/.m2/,type=bind,consistency=cached",
],
This works...
"mounts": [
"source=/home/johndoe/.m2/,target=/home/vscode/.m2/,type=bind,consistency=cached",
],
It looked like this was something fixed recently in VSCode but I still cannot get it to work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论