Add more params to build docker image
Change-Id: I799aded82c5d6c39fc0f6385de4a2f09b1b1e49f
diff --git a/src/com/mirantis/mk/Docker.groovy b/src/com/mirantis/mk/Docker.groovy
index 3975b06..1641cbd 100644
--- a/src/com/mirantis/mk/Docker.groovy
+++ b/src/com/mirantis/mk/Docker.groovy
@@ -13,18 +13,20 @@
* @param baseImg Base image to use (can be empty)
* @param dockerFile Dockerfile to use
* @param timestamp Image tag
+ * @param params Other parameters for docker
* @return "docker app" - result of docker.build
*/
-def buildDockerImage(img, baseImg, dockerFile, timestamp) {
+def buildDockerImage(img, baseImg, dockerFile, timestamp, params=[]) {
def imageDir = dockerFile.substring(0, dockerFile.lastIndexOf("/"))
if (baseImg) {
sh "git checkout -f ${dockerFile}; sed -i -e 's,^FROM.*,FROM ${baseImg},g' ${dockerFile}"
}
+
+ params << "-f ${dockerFile}"
+ params << imageDir
+
return docker.build(
"${img}:${timestamp}",
- [
- "-f ${dockerFile}",
- imageDir
- ].join(' ')
+ params.join(' ')
)
}