简体   繁体   中英

hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method:

"hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: org.jenkinsci.plugins.docker.workflow.Docker.minus() is applicable for argument types: (java.lang.String) values: [/var/lib/jenkins] Possible solutions: find(), image(java.lang.String), is(java.lang.Object), find(groovy.lang.Closure), any(), build(java.lang.String)"

Below is my script, Why I am getting above error? please help me to solve this error

node{
    stage('Login to server') {
        sshagent(['ssh-login']) {
            sh 'ssh -o StrictHostKeyChecking=no  Server_name'
            withCredentials([string(credentialsId: 'dockerhubpwd', variable: 'docker-pwd')]) {
                sh "docker -u my_username -p ${docker-pwd}"
            }

        }
    } }

Either you replace the last sh comand into

sh "docker -u my_username -p ${env.'docker-pwd'}"

Or every occurence of the docker-pwd variable gets renamed to dockerPwd (or whatever value without a dash)

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