Jenkins Amazon ECR: no basic auth credentials

后端 未结 2 1964
花落未央
花落未央 2021-01-17 23:55

I\'m not able to push ocker images to Amazon ECR with Jenkins Pipeline: I always get no basic auth credentials :-(

Here is my setup:

  • Jenki
相关标签:
2条回答
  • 2021-01-18 00:06

    just remove or rename $HOME/.docker/config.json file from your local pc or cloud server. It will solve the no basic auth credentials issue.

    Follow the below step in your terminal:

    mv $HOME/.docker/config.json $HOME/.docker/config.json.backup
    
    0 讨论(0)
  • 2021-01-18 00:08

    Even that it seems logical that docker.withRegistry will perform a login to ECR at start and logout when done, it is not performed. Therefor you must install awscli and add ECR login command before you perform the push.

    sh("eval \$(aws ecr get-login --no-include-email | sed 's|https://||')")

    See http://www.tikalk.com/devops/ecr-in-pipeline/ for detailed example.

    0 讨论(0)
提交回复
热议问题