commit 8309fe06f2651f7c7231235eab21f3b690e10412
parent d489ed2bd731f01a78eef3f545cb4541dbee4905
Author: Andreas Gruhler <agruhl@gmx.ch>
Date: Sun, 28 Sep 2025 12:31:54 +0200
feat(buildah-bud): add Dockerfile path
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/BuildahBud.groovy b/src/BuildahBud.groovy
@@ -8,19 +8,21 @@ class BuildahBud implements Serializable {
// Build with named buildArgs (first)
// Mandatory: Image context and name
- // Optional: Image tag, architecture, registry, ..
+ // Optional: Dockerfile path, Image tag, architecture, registry, ..
void execute(Map buildArgs = [],
String imgContext,
String imgName,
String imgTag = 'latest',
+ String dockerFile = 'Dockerfile',
String imgArch = 'arm64/v8',
String imgRegistry = 'haproxy.lan:5000',
String stageName = 'build') {
- def argList = buildArgs.collect{ k, v -> "--build-arg=${k}=${v}" }.join(' ')
+ // $v can contain additional quoted strings
+ def argList = buildArgs.collect{ k, v -> "--build-arg ${k}=\"${v}\""}.join(' ')
def shCmd = sprintf(
- 'buildah bud --no-cache --arch=%s %s -t %s/%s:%s %s',
- imgArch, argList, imgRegistry, imgName, imgTag, imgContext)
+ 'buildah bud --no-cache --arch=%s %s -t %s/%s:%s -f %s %s',
+ imgArch, argList, imgRegistry, imgName, imgTag, dockerFile, imgContext)
script.stage(stageName) {
script.echo "Building image ${imgRegistry}/${imgName}:${imgTag}..."