eldos
eldos

Reputation: 3272

AWS Elastic Beanstalk Docker environment variables

How to pass environment variables to Docker containers running in AWS Elastic Beanstalk multiple docker container configuration(different for different containers)?

Upvotes: 0

Views: 926

Answers (1)

Nick Humrich
Nick Humrich

Reputation: 15785

Use the environment key in your container descriptions.

{
  "containerDefinitions": [
    {
      "name": "myContainer",
      "image": "something",
      "environment": [
        {
          "name": "MY_DB_PASSWORD",
          "value": "password"
        }
      ],
      "portMappings": [
        {
          "containerPort": 80,
          "hostPort": 80
        }
      ],
      "memory": 500,
      "cpu": 10
    }]
}

For more information, see: http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html

Upvotes: 2

Related Questions