From b37e68cbc351b388ea8f06a04cf3407cf3653e96 Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Thu, 18 Jul 2024 20:53:35 +0100 Subject: [PATCH] Simplify, no need for a multi-stage build when creating OCI image model COPY automatically creates necessary directories Co-Authored-By: Daniel J Walsh Signed-off-by: Eric Curtin --- ramalama | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ramalama b/ramalama index 7d62dcc..72c37df 100755 --- a/ramalama +++ b/ramalama @@ -335,17 +335,13 @@ list_cli() { } build() { - local to="models/$sym_target" - local from="/models/$model_name" - cd "$llm_store" + local from="$sym_target" + local to="/models/$model_name" + cd "$llm_store/models" local containerfile containerfile=$(mktemp) - echo "FROM quay.io/ramalama/ramalama:latest AS builder -RUN mkdir -p /models -COPY $to $from - -FROM scratch -COPY --from=builder /models /models" > "$containerfile" + echo "FROM scratch +COPY $from $to" > "$containerfile" "${conman[@]}" build -t "$model_name" -f "$containerfile" . rm "$containerfile" cd - > /dev/null