Step 1 – addding required files source repository

AWS CodeBuild will build a Docker image and push it to the Amazon ECR. Create buildspec.yml and add this file to the repository that tells AWS CodeBuild about how to build.

Build specification files contain the following stages:

  • Pre-build stage:
    • Log in to Amazon ECR.
    • Set repository URI for Amazon ECR image. Add image tag with the first seven characters of Git commit ID.
  • Build stage:
    • Build Docker image. Tag image as the latest and with the Git commit ID.
  • Post-build stage:
    • You can push the image to the Amazon ECR repository with both the tags.
    • Create a file PacktECS.json that contains the Amazon ECS container name and its image and tag. In the deployment stage, the CD pipeline will use ...

Get Expert AWS Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.