Docker撰写嵌套环境变量 [英] Docker Compose Nested Environment Variable
本文介绍了Docker撰写嵌套环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个现有的应用程序,该应用程序使用的应用程序配置文件如下所示:
I have an existing app that uses a app config file that looks like:
"ConnectionInfo": {
"ServerName": "The Server URL",
"DatabaseName": "The DatabaseName",
"UserName": "The User Name",
"Password": "The Password"}
现在,当我进行简单设置时,说
Now, when I have a simple setting, say
"ConnectionString":"My Connection String"
我了解如何在compose.yml文件中覆盖它:
I understand how to override it in the compose.yml file:
environment:
- ConnectionString=what I want it to be
问题是,如何在顶部设置服务器名称?
The question is, how do you set, say, the server name in the top?
推荐答案
请使用双下划线(__)代替冒号(:).
Please use double underscore (__) as the following instead of a colon (:).
environment:
- ConnectionInfo__ServerName=MyServerName
查看全文