我是AWS Docker的新手,我想在ECS的任务定义中设置一个环境变量,然后从Docker容器的C#代码中读取它。首先,有可能吗?如果是,该如何实现?
下面是我的task.json文件
{
"family": "task-logging-poc",
"containerDefinitions": [
{
"image": "XYZ",
"name": "logging-poc-1",
"cpu": 1024,
"memory": 1024,
"essential": true,
"mountPoints": [
{
"sourceVolume": "log",
"containerPath": "c:/data"
}
]
}
]
}
答案 0 :(得分:1)
像这样:
"environment" : [
{ "name" : "string", "value" : "string" },
{ "name" : "string", "value" : "string" }
]
请参阅this