Home > Mobile >  Can't push image - fails with "no basic auth credentials"
Can't push image - fails with "no basic auth credentials"

Time:05-17

GitLab CICD Pipeline failed in the development stage, Successfully built and tagged but Failed while push refers to Amazon repository(ECR).

*6be90f1a2d3f: Preparing
no basic auth credentials
Cleaning up project directory and file based variables 
ERROR: Job failed: exit code 1*

CodePudding user response:

You need to check the value of your GitLab job secrets regarding:

  • AWS_REGISTRY_URL
  • AWS_DEFAULT_REGION
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY

As in this thread (for a bitBucket pipeline, but can be applied to a GitLab one), your pipeline should include a login step

eval $(aws ecr get-login --no-include-email --region YOUR-REGION-HERE | sed 's|https://||')

make sure to change the region from YOUR-REGION-HERE to the one you are trying to deploy to. For me this is --region ap-southeast-2.

  • Related