Adding build args support

This commit is contained in:
2025-03-26 21:40:56 +01:00
parent 1b5964266a
commit 92932d3fa7
2 changed files with 13 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ INPUT_PULL_CACHE=$pullCache
INPUT_DOCKERFILE_PATH=$path
INPUT_PLATFORM=$platform
INPUT_EXPORT_TAR=$exportTarPath
INPUT_BUILD_ARGS=$buildArgs
set -e
@@ -29,6 +30,14 @@ fi;
DOCKER_BUILD_OPTIONS=("--progress" "plain" "-t" "$IMAGE_NAME")
if [[ -n "${INPUT_BUILD_ARGS}" ]]; then
IFS=',' read -ra allBuildArgs <<< "${INPUT_BUILD_ARGS}"
for dockerArg in "${allBuildArgs[@]}"; do
DOCKER_BUILD_OPTIONS+=("--build-arg" "$dockerArg")
done
fi
if [ -n "$INPUT_PLATFORM" ]; then
DOCKER_BUILD_OPTIONS+=("--platform" "$INPUT_PLATFORM" "--pull")
fi