By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Local CodeBuild project and ECR login problem

0

I have a buildspec file that logs in to ECR:

- aws ecr get-login-password --region eu-west-2 | docker login --username AWS --password-stdin 123.dkr.ecr.eu-west-2.amazonaws.com

This buildspec file runs fine in a CodeBuild project. In my local terminal if I run the above command, I also get 'Login Succeeded' message.

My issue is that when I try to run this CodeBuild project locally, I get ECR login error:

Unable to locate credentials. You can configure credentials by running "aws configure".
agent-1  | Error: Cannot perform an interactive login from a non TTY device

I am running a local CodeBuild project like this:

./codebuild_build.sh -i aws/codebuild/standard:7.0 -a /path-to-artifact/artifacts  -s /path-to-app/FagateApp

I have checked my access key etc with aws configure and region is set to eu-west-2

thanks

asked 4 months ago282 views
1 Answer
3
Accepted Answer

In order to pass your local host credentials to the build container you need to use the -c flag (see here).

profile pictureAWS
EXPERT
answered 4 months ago
profile picture
EXPERT
reviewed 4 months ago
  • Perfect. My online search could not help how you have helped. thanks

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions