如何将环境变量传递给在AWS Elastic Beanstalk中运行的Docker容器多个docker容器配置(对于不同的容器不同)?
答案 0 :(得分:2)
在容器说明中使用environment
键。
{
"containerDefinitions": [
{
"name": "myContainer",
"image": "something",
"environment": [
{
"name": "MY_DB_PASSWORD",
"value": "password"
}
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
}
],
"memory": 500,
"cpu": 10
}]
}
有关详细信息,请参阅:http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html