Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CodeBuild ECR CannotPullContainerError

CodeBuild project fails at the Provisioning phase due to the following error

BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE: Unable to pull customer's container image. CannotPullContainerError: Error response from daemon: pull access denied for <image-name>, repository does not exist or may require 'docker login': denied: User: arn:aws:sts::<id>

enter image description here

like image 517
Chaitanya Bapat Avatar asked Jan 06 '21 04:01

Chaitanya Bapat


1 Answers

The issue was with the Image Pull credentials. CodeBuild was using default AWS CodeBuild credentials for pulling the image while the ECRAccessPolicy was attached to the Project Service Role.

I fixed it by updating the image pull credentials to use project service role.

enter image description here

like image 180
Chaitanya Bapat Avatar answered Sep 25 '22 11:09

Chaitanya Bapat