1

I am creating a CodePipeline for my application, but the deployment process for AWS ElasticBeanstalk is failing with the following error:

Instance deployment: Both 'Dockerfile' and 'Dockerrun.aws.json' are missing in your source bundle. Include at least one of them. The deployment failed.

The complete message error is:

Deployment completed, but with errors: During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version. Failed to deploy application. Unsuccessful command execution on instance id(s) 'i-0b8823de2e7376c81'. Aborting the operation. [Instance: i-0b8823de2e7376c81] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error.. Instance deployment failed. For details, see 'eb-engine.log'. Instance deployment: Both 'Dockerfile' and 'Dockerrun.aws.json' are missing in your source bundle. Include at least one of them. The deployment failed.

My environment has 3 containers and to deploy this environment I use the docker-compose-qa.yml file and in AWS CodeBuild I'm defining this file as an artifact, as shown below:

artifacts:
  files:
    - 'docker-compose-qa.yml'

The docker-compose-qa.yml:

version: '3.8'

services:

    sitr-api:
        image: ${{ secrets.SITR_API_QA_URI_DOCKER_IMG }}
        container_name: sitr-api-qa
        environment:
            - ASPNETCORE_ENVIRONMENT=QA
        ports:
            - "9901:80"
        volumes:
            - "./Host-Logs:/app/App_Data/Logs"

    sitr-app:
        image: ${{ secrets.SITR_APP_QA_URI_DOCKER_IMG }}
        container_name: sitr-app-qa
        ports:
            - "9902:80"
    
    sitr-nginx: 
        image: ${{ secrets.SITR_NGINX_QA_URI_DOCKER_IMG }}
        container_name: sitr-nginx-qa
        depends_on: 
          - sitr-app
          - sitr-api
        ports: 
          - "80:80"

eb-engine.log error:

2021/10/26 22:07:27.977004 [ERROR] An error occurred during execution of command [app-deploy] - [Docker Specific Build Application]. Stop running the command. Error: Dockerfile and Dockerrun.aws.json are both missing, abort deployment

2021/10/26 22:07:27.977008 [INFO] Executing cleanup logic 2021/10/26 22:07:27.977098 [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: Both 'Dockerfile' and 'Dockerrun.aws.json' are missing in your source bundle. Include at least one of them. The deployment failed.","timestamp":1635286047,"severity":"ERROR"},{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1635286047,"severity":"ERROR"}]}]}

My CodeBuild just build a dotnet application, angular aplication and build the 3 docker containers for both application and nginx.

If I run my CodeBuild manually and then choose my docker-compose-qa.yml file in AWS EB, the publication is successfully applied.

I checked AWS S3 Bucket and the file is being zipped to a folder for the artifact.

The question is:

Why is Pipeline complaining about the non-existence of 'Dockerfile' and 'Dockerrun.aws.json' files? How can I specify it to use the docker-compose-qa.yml file?

7
  • Sadly your question lacks details. What exactly is your EB platform? How did you define your CodeBuild. Not sure what CodeDeploy has anything to do with that? Commented Oct 26, 2021 at 23:14
  • @Marcin my CodeBuild just build a dotnet application, angular aplication and build the 3 docker containers for both application and nginx. I edited the question in more detail but if I need the full CodeBuild I can post in the question. Commented Oct 26, 2021 at 23:27
  • 1
    You wrote " in AWS CodeDeploy I'm defining this file as an artifact, as shown below"? I guess it should be CodeBuild? Also you must rename docker-compose-qa.yml into docker-compose.yml. Commented Oct 26, 2021 at 23:32
  • It should be called docker-compose.yml, not docker-compose-qa.yml. Commented Oct 26, 2021 at 23:34
  • 1
    @Marcin It just finished, it worked yes, it was just the name of the file! If you can post as an answer, I accept it here! :) Commented Oct 26, 2021 at 23:44

1 Answer 1

1

Based on the comments.

The issue was caused by wrong file name. It should be called docker-compose.yml, not docker-compose-qa.yml. Renaming the file solved the issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.