From 1db6185454f27cd3f38fc5649687f7aff089490f Mon Sep 17 00:00:00 2001 From: Jan De Landtsheer Date: Sun, 31 Aug 2025 12:46:13 +0200 Subject: [PATCH] fix: Docker container build command parsing - Fix docker_run_build to properly extract script path from full command - Separate script path from arguments for chmod execution - Prevents chmod errors when passing arguments to build script --- scripts/lib/docker.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/lib/docker.sh b/scripts/lib/docker.sh index 4dc4a12..8efcb14 100644 --- a/scripts/lib/docker.sh +++ b/scripts/lib/docker.sh @@ -152,26 +152,29 @@ function docker_start_rootless() { # Run build command in container function docker_run_build() { - local build_script="${1:-./scripts/build.sh}" + local build_command="${1:-./scripts/build.sh}" local image="${2:-${BUILDER_IMAGE}}" section_header "Running Build in Container" + # Extract script path from command (first part before any arguments) + local script_path=$(echo "$build_command" | cut -d' ' -f1) + # Ensure build script is executable - safe_execute chmod +x "${PROJECT_ROOT}/${build_script}" + safe_execute chmod +x "${PROJECT_ROOT}/${script_path}" # Setup container arguments local user_args="--user $(id -u):$(id -g)" local volume_args="-v ${PROJECT_ROOT}:/workspace" local work_args="-w /workspace" - log_info "Executing build script in container: ${build_script}" + log_info "Executing build command in container: ${build_command}" safe_execute ${CONTAINER_RUNTIME} run --rm \ ${user_args} \ ${volume_args} \ ${work_args} \ "${image}" \ - ${build_script} + ${build_command} } # Commit container state for reuse