4

Could somebody please point me to the correct Dockerrun.aws.json v3 documentation. I have done google many times and unable to find this v3 documentation.

I am trying to do multi-container deployment to elastic beanstalk with Docker running on 64bit Amazon Linux 2/3.2.2 but unsuccessful so far.

So far I am using Dockerrun.aws.json v2 format which seems to not work with this docker platform.

{
  "AWSEBDockerrunVersion": 2,
  "containerDefinitions": [
    {
    "name": "simple-ui",
      "image": "my-image-located-in-ECR",
      "essential": true,
      "memory": 128,
      "portMappings": [
        {
          "hostPort": 80,
          "containerPort": 3000
        }
      ],
      "command": ["npm","start"]
    }
  ]
}

Below is the error I am seeing in EB logs:

2020/12/09 18:55:34.954345 [ERROR] An error occurred during execution of command [app-deploy] - [Docker Specific Build Application]. Stop running the command. Error: parse Dockerrun.aws.json file failed with error json: invalid use of ,string struct tag, trying to unmarshal unquoted value into int

2020/12/09 18:55:34.954356 [INFO] Executing cleanup logic 2020/12/09 18:55:34.954437 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment: 'Dockerrun.aws.json' in your source bundle specifies an unsupported version. Elastic Beanstalk only supports version 1 for non compose app and version 3 for compose app. The deployment failed.","timestamp":1607540134,"severity":"ERROR"},{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1607540134,"severity":"ERROR"}]}]}

Thank you for your help in advance. Rabin

Marcin
  • 215,873
  • 14
  • 235
  • 294
Rabin Limbu
  • 45
  • 1
  • 5

4 Answers4

4

Docker running on 64bit Amazon Linux 2/3.2.2

You are using Docker running on 64bit Amazon Linux 2/3.2.2 which, as the error write, is used only for Dockerrun.aws.json v1.

To use v2, you have to use EB platform:

Multi-container Docker running on 64bit Amazon Linux
Marcin
  • 215,873
  • 14
  • 235
  • 294
  • 3
    thanks in the end I ended up using multi-container docker platform with Dockerrun.aws.json v2. AWS documentation says 64bit Amazon Linux 2 is the newer version for docker platform that supposed to work with docker-compose and Dockerrun.aws.json v3 but I couldn't make it work with docker-compose and couldn't find documentation for v3. I will also go ahead and update title of this post to fit more appropriately with this Q&A, Thanks again. – Rabin Limbu Dec 13 '20 at 23:31
4

The multi-container docker platform is deprecated and missing a lot of features that you'll find in the plain jane Docker platform on EB. However the docs are extremely confusing as you noticed above. Check out this stack overflow post for more details.

How to use multi container docker in Elastic beanstalk using Amazon linux 2?

Mark At Ramp51
  • 5,343
  • 1
  • 25
  • 30
0

With 64bit Amazon Linux 2 for multi container setups it's very important to make sure the elasticbeanstalk buildspec.yml has these two file artifacts

artifacts:
    files: 
      - 'Dockerrun.aws.json'
      - 'docker-compose.yml'`

You can verify that the file is within the source by going to:

Elastic Beanstalk > Applications > { application name } > Application versions

and then clicking on the source of the latest application to download the folder.

I was only sending the Dockerrun.aws.json to EBS and then thus wondering why I got the same v1 v3 error you got. In hindsight this make a lot of sense that the docker-compose.yml is needed.

Dharman
  • 30,962
  • 25
  • 85
  • 135
tim
  • 66
  • 2
0

I had exactly the same worries. I changed the value of "AWSEBDockerrunVersion" in "Dockerrun.aws.json" of version 1 to "3" and then deployed it.

Then, strangely, the following message was displayed.

Instance deployment: 'Dockerrun.aws.json' in your source bundle specifies an unsupported version. Elastic Beanstalk only supports version 1 for non compose app and version 3 for compose app. The deployment failed.

This means that you can just use version 1 of json for Amazon Linux 2 AMIs.

Yuki SHIDA
  • 31
  • 2