Ошибка команды Docker .withRun () - PullRequest
       11

Ошибка команды Docker .withRun ()

0 голосов
/ 27 сентября 2019

Я пытаюсь изменить пользователя на uid на 0

docker.image('pahud/eks-kubectl-docker').withRun('-u 0:0').inside.{
          withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', 
                        credentialsId: awsCredentialsId,
                        accessKeyVariable: 'AWS_ACCESS_KEY_ID',  
                        secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']])

            {
           sh 'AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} AWS_DEFAULT_REGION=us-west-2  CLUSTER_NAME=oeksctl'

      sh 'aws eks --region us-west-2 update-kubeconfig --name eksctl'

Я получаю следующую ошибку

hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: static org.jenkinsci.plugins.docker.workflow.Docker.withRun() is applicable for argument types: (java.lang.String) values: [-u 0:0]
Possible solutions: with(groovy.lang.Closure), withTool(java.lang.String, groovy.lang.Closure)
    at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1501)
    at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1487)

1 Ответ

0 голосов
/ 28 сентября 2019

это должно быть так

docker.image('pahud/eks-kubectl-docker').inside('-u 0:0'){

вместо

docker.image('pahud/eks-kubectl-docker').withRun('-u 0:0').inside{
...