AWS Elastic Beanstalk Docker环境变量

时间:2015-05-23 13:33:05

标签: amazon-web-services docker elastic-beanstalk

如何将环境变量传递给在AWS Elastic Beanstalk中运行的Docker容器多个docker容器配置(对于不同的容器不同)?

1 个答案:

答案 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