Jenkins Amazon ECR: no basic auth credentials

后端 未结 2 1977
花落未央
花落未央 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: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.

提交回复
热议问题