fix: explicitly unset UV index vars when not in use

Docker BuildKit makes ARG values available as environment variables in RUN
commands. This means UV sees UV_INDEX_STRATEGY even when empty and complains.
Explicitly unset these vars in the else branch to prevent UV from seeing them.
This commit is contained in:
Ashwin Bharambe 2025-10-31 11:55:59 -07:00
parent 5c76f20e16
commit bbaed611b2

View file

@ -85,6 +85,7 @@ RUN set -eux; \
UV_EXTRA_INDEX_URL="$UV_EXTRA_INDEX_URL" UV_INDEX_STRATEGY="$UV_INDEX_STRATEGY" \ UV_EXTRA_INDEX_URL="$UV_EXTRA_INDEX_URL" UV_INDEX_STRATEGY="$UV_INDEX_STRATEGY" \
uv pip install --no-cache-dir -e "$LLAMA_STACK_DIR"; \ uv pip install --no-cache-dir -e "$LLAMA_STACK_DIR"; \
else \ else \
unset UV_EXTRA_INDEX_URL UV_INDEX_STRATEGY; \
uv pip install --no-cache-dir -e "$LLAMA_STACK_DIR"; \ uv pip install --no-cache-dir -e "$LLAMA_STACK_DIR"; \
fi; \ fi; \
elif [ "$INSTALL_MODE" = "test-pypi" ]; then \ elif [ "$INSTALL_MODE" = "test-pypi" ]; then \