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
Perfect. My online search could not help how you have helped. thanks