简体   繁体   中英

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

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*

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM