Docker Compose Nested Environment Variable

那年仲夏 提交于 2019-12-05 18:51:36

Please use underscore (__) as the following instead of a colon (:).

environment:
  - ConnectionInfo__ServerName=MyServerName

Please refer to Configuration in ASP.NET Core

For hierarchical config values specified in environment variables, a colon (:) may not work on all platforms. Double underscore (__) is supported by all platforms.

You can set nested configurations using a colon to separate the nested sections:

To set the server name here:

"ConnectionInfo": {
    "ServerName": "override this via compose environment"
}

Override it like this:

environment:
  - ConnectionInfo:ServerName=MyServerName
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!