在Jenkins管道中找不到docker

时间:2019-07-10 09:10:12

标签: docker jenkins

我正在跟踪basic example,将jenkins管道用于docker映像。

在构建开始时,出现docker: command not found错误:

[Pipeline] Start of Pipeline
[Pipeline] node
Running on FleetCloud XXX in /tmp/jenkins-XXX/workspace/XXX-pipeline
[Pipeline] {
[Pipeline] sh
+ docker inspect -f . node:7-alpine
/tmp/jenkins-XXX/workspace/XXX-pipeline@tmp/durable-92bb0321/script.sh: line 1: docker: command not found
[Pipeline] sh
+ docker pull node:7-alpine
/tmp/jenkins-XXX/workspace/XXX-pipeline@tmp/durable-8317f88b/script.sh: line 1: docker: command not found
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
sh: line 1: 12623 Terminated              sleep 3
sh: line 1: 12636 Terminated              sleep 3
ERROR: script returned exit code 127
Finished: FAILURE

这是Jenkins文件:

pipeline {
    agent {
        docker { image 'node:7-alpine' }
    }
    stages {
        stage('Test') {


    steps {
            sh 'node --version'
        }
    }
}

}

关于为什么不能混混Docker的任何想法?

0 个答案:

没有答案