将Windows环境变量传递给Docker -Visual Studio
我想避免在我的启动集合中进行硬编码的环境变量。json,并希望其中一些位于机器级别而不是项目级别。
我最初是从此开始的:
"DockerfileRunArguments": "-v \"C:\\Oracle\\product\\12.1.0\\client_1\\network\\admin:/root/tns\"",
作为替代方案,我试图这样做:
"DockerfileRunArguments": "-v \"%TNS_ADMIN%:/root/tns\"",
我假设在Visual Studio中它穿过命令行时,它将获得%TNS_ADMIN%并替换它,就像Echo%TNS_ADMIN一样命令行。真的不想在项目级别的映射下进行此操作。
I want to avoid hard-coding environmental variables into my launchSettings.json and want some of them to be at a machine level rather than a project level.
I started originally with this:
"DockerfileRunArguments": "-v \"C:\\Oracle\\product\\12.1.0\\client_1\\network\\admin:/root/tns\"",
And as an alternative tried to do this:
"DockerfileRunArguments": "-v \"%TNS_ADMIN%:/root/tns\"",
I assumed when in Visual Studio it ran through the command line, it would obtain %TNS_ADMIN% and replace it, just as an echo %TNS_ADMIN% is doing from a standard command line. Really don't want to have this at a project level mapping.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论