How to build Image from Dockerfile in AWS CodePipeline using buildspec.yml, and then push to ECR?

I have a Dockerfile in a CodeCommit Repository. I’m building a pipeline with two Stages which should:

  1. Connect to CodeCommit Source (successful)
  2. Build the image from Dockerfile in the Repository and push it to ECR (not successful)

I tried the following but, it exits with exit status 127 because of the command IMAGE_URI= $REPO_URI:$IMAGE_TAG. buildspec.yaml

Source: Docker Questions