我的JenkinsFile看起来像这样:
pipeline {
agent {
docker {
image 'node:12.16.2'
args '-p 3000:3000'
}
}
stages {
stage('Build') {
steps {
sh 'node --version'
sh 'npm install'
sh 'npm run build'
}
}
stage ('Deliver') {
steps {
sh 'readlink -f ./package.json'
}
}
}
}我曾经在本地使用Jenkins,此配置有效,但我将其部署到远程服务器,并得到以下错误:
WorkflowScript: 3: Invalid agent type "docker" specified. Must be one of [any, label, none] @ line 3, column 9.
docker { 3.我在网上找不到解决这个问题的办法,请帮帮我
发布于 2020-06-14 18:25:39
你必须安装两个插件:Docker plugin和Docker Pipeline。希望这能有所帮助。
发布于 2021-09-13 15:57:43
而不是代理{ docker { image 'node:12.16.2‘args '-p 3000:3000’}}
试用代理{ any { image 'node:12.16.2‘args '-p 3000:3000’}}
这对我很管用。
https://stackoverflow.com/questions/62253474
复制相似问题