【发布时间】:2018-02-10 09:27:51
【问题描述】:
使用这个最小的 Jenkins 流水线脚本
node {
docker.build("foo", "--build-arg x=y")
}
我遇到了一个令人困惑的错误
“docker build”只需要 1 个参数。
但根据文档,docker.build() 的签名是 build(image[, args])(来自 Jenkins /job/dockerbug/pipeline-syntax/globals#docker)
build(image[, args])运行 docker build 来创建和标记指定的 来自当前目录中的 Dockerfile 的图像。额外的参数可能 被添加,例如
'-f Dockerfile.other --pull --build-arg http_proxy=http://192.168.1.1:3128 .'。像 docker build 一样,args 必须 以构建上下文结束。返回生成的 Image 对象。 在构建中记录 FROM 指纹。
发生了什么事?
【问题讨论】:
标签: docker jenkins jenkins-pipeline