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