0

I'm transitioning one of my AWS Elastic Beanstalk applications over to Docker using Elastic Beanstalk's Multi-container Docker configuration. I've created a new EB Application with a new environment. When I attempt to deploy my Dockerrun.aws.json config, EB eventually fails with the following error in the events tab:

Service:AmazonECS, Code:ClientException, Message:Invalid setting for container 'api'. At least one of 'memory' or 'memoryReservation' must be specified., Class:com.amazonaws.services.ecs.model.ClientException 

My Dockerrun.aws.json config is roughly as follows:

{ "AWSEBDockerrunVersion": 2, "containerDefinitions": [ { "name": "api_proxy", "image": "{account_id}.dkr.ecr.us-east-1.amazonaws.com/{repo}:latest", "essential": true, "memory": 128, "portMappings": [ { "hostPort": 80, "containerPort": 80 } ], "links": [ "api" ] }, { "name": "api", "image": "{account_id}.dkr.ecr.us-east-1.amazonaws.com/{repo}:latest", "environment": { "DJANGO_SETTINGS_MODULE": "api.aws" }, "essential": true, "memory": 128 } ] } 

Any help would definitely be appreciated.

Update 2018-02-15:

My current deployment process is as follows. I first create the Docker images and upload them to Amazon's ECR. I then zip the Dockerrun.aws.json file. Since this is the first deployment of the app in a new AWS EB environment, I'm currently uploading the zip file in the environment creation process. The platform I'm choosing is Preconfigured platform: Multi-container Docker. For Application Code, I upload my zipfile containing the Dockerrun.aws.json file.

4
  • How do you deploy the app? Commented Feb 15, 2018 at 19:35
  • Just added a section on some basics of how I'm currently deploying the app. Commented Feb 15, 2018 at 20:06
  • What version of platform are you using? Commented Feb 16, 2018 at 11:56
  • The platform is "Multi-container Docker 17.09.1-ce (Generic)" Commented Feb 16, 2018 at 23:41

1 Answer 1

2

As far as I can see from off doc - environment option should be object array, so your json should looks like

{ "AWSEBDockerrunVersion": 2, "containerDefinitions": [{ "name": "api", "image": "nginx:latest", "essential": true, "memory": 128, "environment": [{ "name": "DJANGO_SETTINGS_MODULE", "value": "api.aws" }] },{ "name": "api_proxy", "image": "nginx:latest", "essential": true, "memory": 128, "links": ["api"], "portMappings": [{ "hostPort": 80, "containerPort": 80 }] }] } 

At least I was able to run environment with the json above

1
  • Oh my... Yes that was all it was, the environment section wasn't written correctly. The memory config was after environment which caused the red herring error message. Commented Feb 20, 2018 at 0:24

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.