Exit status 255 typically indicates an error occurred during the execution of a command or script. In the case of AWS ECR, there could be several reasons why you are seeing this error, even if you are using AWS Ubuntu containers. Here are possible causes and solutions:
This status code usually indicates an unauthorized user. To fix this, we need to let our Code Build role be able to talk to ECR. To do this: Go to IAM and then attach an AmazonEC2ContainerRegistryPowerUser policy to your CodeBuild role.