DEV Community

Set up CI/CD for containerized React App using Docker, AWS CodeBuild, AWS ECS, AWS CodePipeline & Github

Mubbashir Mustafa on May 07, 2020

This is the last part of the series "Dev-ops for Front-End developers". I assume you already have: -Containerized your React Application using Doc...
Collapse
 
chris7721 profile image
Chris7721 •

Great. But I get this error when the code tries to build

YAML_FILE_ERROR Message: Unknown runtime named 'docker'. This build image has the following runtimes: dotnet, golang, java, nodejs, php, python, ruby

Collapse
 
mubbashir10 profile image
Mubbashir Mustafa • • Edited

So it seems like in version 5 they have removed "Docker: 19" and from now onwards default docker runtime will be available only. To make this code work you can:

  • Either change the runtime to v4 or less (the article was written at the time when v3 was the latest available). dev-to-uploads.s3.amazonaws.com/i/...
  • Or remove this 👇🏽 (if you are using v5)
install:
    runtime-versions:
      docker: latest
Enter fullscreen mode Exit fullscreen mode
Collapse
 
mubbashir10 profile image
Mubbashir Mustafa •
Collapse
 
chris7721 profile image
Chris7721 •

Oh thanks! Would try this and see how it works.

Thread Thread
 
mubbashir10 profile image
Mubbashir Mustafa •

Sweet. Please do share how it goes!

Thread Thread
 
chris7721 profile image
Chris7721 •

It worked, but having another issue, the build break when it tries to run this

$(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)

The error message is:
An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:sts:::assumed-role/codebuild-main--build-service-role/AWSCodeBuild--5c2c-4dff-a514- is not authorized to perform: ecr:GetAuthorizationToken on resource: *

[Container] 2021/02/07 14:25:18 Command did not exit successfully $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email) exit status 255

Collapse
 
rynebenson profile image
Ryne Benson • • Edited

I need to setup a staging environment for me and my team to test code before we ship to production. Is there a way to add this as a step in this current process or do I need to setup a separate pipeline with the staging branch as a source?

Collapse
 
mubbashir10 profile image
Mubbashir Mustafa •

A separate environment with a separate pipeline.