mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 15:23:51 +00:00
fix: build container script
# What does this PR do? ## Test Plan
This commit is contained in:
parent
3c43a2f529
commit
b833da0d15
1 changed files with 9 additions and 2 deletions
|
@ -202,8 +202,14 @@ install_local_package() {
|
|||
fi
|
||||
|
||||
if [ "$USE_COPY_NOT_MOUNT" = "true" ]; then
|
||||
# Docker COPY needs relative path from build context
|
||||
# we need to copy them to the build context first
|
||||
local basename=$(basename "$dir")
|
||||
local temp_name="${basename}-tmp-$$"
|
||||
echo "Copying $dir to build context as $temp_name..." >&2
|
||||
cp -r "$dir" "$BUILD_CONTEXT_DIR/$temp_name"
|
||||
add_to_container << EOF
|
||||
COPY $dir $mount_point
|
||||
COPY $temp_name $mount_point
|
||||
EOF
|
||||
fi
|
||||
add_to_container << EOF
|
||||
|
@ -327,8 +333,9 @@ $CONTAINER_BINARY build \
|
|||
-f "$TEMP_DIR/Containerfile" \
|
||||
"$BUILD_CONTEXT_DIR"
|
||||
|
||||
# clean up tmp/configs
|
||||
# clean up tmp/configs and any temporary copied directories
|
||||
rm -f "$BUILD_CONTEXT_DIR/run.yaml"
|
||||
rm -rf "$BUILD_CONTEXT_DIR"/*-tmp-*
|
||||
set +x
|
||||
|
||||
echo "Success!"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue