Search code examples
amazon-web-servicesamazon-elastic-beanstalkaws-codepipelineaws-codebuildamazon-ecr

No ecs task definition (or empty definition file) found in environment


System

CI/CD using AWS CodePipeline:

  • AWS CodeBuild connect Github 2
  • AWS Beanstalk using images from ECR, Multi-container docker platform

Error

Deployment completed, but with errors: Failed to deploy application. No ecs task definition (or empty definition file) found in environment

Elastic Beanstalk Upload Application

app.zip
  |
  --Dockerrun.aws.json
  |
  --nginx
     |
     --default.conf

Dockerrun.aws.json

Content here.

I tried to deploy only Elastic Beanstalk using images after building and file app.zip, and surprisingly it worked.

Thanks in advance!


Solution

  • I solved this issue.

    I thought that EB will read the file Dockerrun.aws.json from zip file I uploaded. However, EB using the Docker platform read that file from the image. I put the file Dockerrun to the image and it worked.