From a7008dc15d5dbb4f2a9e833ff89fcbd814b40889 Mon Sep 17 00:00:00 2001 From: Michael Clifford Date: Wed, 19 Mar 2025 19:18:11 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20Correctly=20set=20CLI=5FARGS=20using=20B?= =?UTF-8?q?UILD=5FPLATFORM=20env=20with=20llama=20stack=E2=80=A6=20(#1702)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What does this PR do? This PR updates `build_container.sh` to prevent an "unknown flag" error when using the `BUILD_PLATFORM` environment variable during `llama stack build`. [//]: # (If resolving an issue, uncomment and update the line below) [//]: # (Closes #[issue-number]) Closes #1699 ## Test Plan Running the following code with out these changes results in an "unknown flag" error. ``` CONTAINER_BINARY=podman BUILD_PLATFORM=linux/amd64 llama stack build --template ollama --image-type container ``` With these changes, the same command should build the image correctly. Signed-off-by: Michael Clifford --- llama_stack/distribution/build_container.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama_stack/distribution/build_container.sh b/llama_stack/distribution/build_container.sh index a8346c3b6..e949927d2 100755 --- a/llama_stack/distribution/build_container.sh +++ b/llama_stack/distribution/build_container.sh @@ -235,7 +235,7 @@ image_tag="$image_name:$version_tag" # Detect platform architecture ARCH=$(uname -m) if [ -n "$BUILD_PLATFORM" ]; then - CLI_ARGS+=("--platform $BUILD_PLATFORM") + CLI_ARGS+=("--platform" "$BUILD_PLATFORM") elif [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then CLI_ARGS+=("--platform" "linux/arm64") elif [ "$ARCH" = "x86_64" ]; then