mirror of
https://github.com/mostlygeek/llama-swap.git
synced 2026-06-09 06:46:34 +02:00
docker: fix arm64 cpu image downloading amd64 llama-swap binary (#819)
Build Containers / build-and-push (intel) (push) Failing after 47s
Build Containers / build-and-push (rocm) (push) Failing after 11m36s
Build Containers / build-and-push (musa) (push) Failing after 11m38s
Build Containers / build-and-push (cuda13) (push) Failing after 13m19s
Build Containers / build-and-push (cuda) (push) Failing after 14m56s
Build Containers / build-and-push (cpu) (push) Failing after 14m58s
Build Containers / build-and-push (vulkan) (push) Failing after 14m49s
Build Containers / delete-untagged-containers (push) Failing after 14m59s
Build Containers / build-and-push (intel) (push) Failing after 47s
Build Containers / build-and-push (rocm) (push) Failing after 11m36s
Build Containers / build-and-push (musa) (push) Failing after 11m38s
Build Containers / build-and-push (cuda13) (push) Failing after 13m19s
Build Containers / build-and-push (cuda) (push) Failing after 14m56s
Build Containers / build-and-push (cpu) (push) Failing after 14m58s
Build Containers / build-and-push (vulkan) (push) Failing after 14m49s
Build Containers / delete-untagged-containers (push) Failing after 14m59s
Replace TARGETARCH build-arg with runtime arch detection via uname -m. BuildKit's TARGETARCH injection was unreliable for the multi-arch cpu build, causing the arm64 image variant to download and embed the x86_64 llama-swap binary — resulting in "exec format error" on arm64 hosts. With QEMU user-space emulation, uname -m correctly returns aarch64 inside an arm64 container build, so the download always fetches the right binary for the actual target architecture. Also adds --fail to curl so HTTP 404s produce a build error instead of silently embedding an HTML error page. fixes #818 Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,10 +2,6 @@ ARG BASE_IMAGE=ghcr.io/ggml-org/llama.cpp
|
|||||||
ARG BASE_TAG=server-cuda
|
ARG BASE_TAG=server-cuda
|
||||||
FROM ${BASE_IMAGE}:${BASE_TAG}
|
FROM ${BASE_IMAGE}:${BASE_TAG}
|
||||||
|
|
||||||
# has to be after the FROM
|
|
||||||
# TARGETARCH is auto-set by `docker buildx build --platform …` (amd64/arm64);
|
|
||||||
# falls back to amd64 when an older `docker build` runs without buildx.
|
|
||||||
ARG TARGETARCH=amd64
|
|
||||||
ARG LS_VER=170
|
ARG LS_VER=170
|
||||||
ARG LS_REPO=mostlygeek/llama-swap
|
ARG LS_REPO=mostlygeek/llama-swap
|
||||||
|
|
||||||
@@ -37,9 +33,15 @@ WORKDIR /app
|
|||||||
ENV PATH="/app:${PATH}"
|
ENV PATH="/app:${PATH}"
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
curl -LO "https://github.com/${LS_REPO}/releases/download/v${LS_VER}/llama-swap_${LS_VER}_linux_${TARGETARCH}.tar.gz" && \
|
set -eux; \
|
||||||
tar -zxf "llama-swap_${LS_VER}_linux_${TARGETARCH}.tar.gz" && \
|
case "$(uname -m)" in \
|
||||||
rm "llama-swap_${LS_VER}_linux_${TARGETARCH}.tar.gz"
|
x86_64) ARCH=amd64 ;; \
|
||||||
|
aarch64) ARCH=arm64 ;; \
|
||||||
|
*) echo "unsupported arch: $(uname -m)" >&2; exit 1 ;; \
|
||||||
|
esac; \
|
||||||
|
curl --fail -LO "https://github.com/${LS_REPO}/releases/download/v${LS_VER}/llama-swap_${LS_VER}_linux_${ARCH}.tar.gz" && \
|
||||||
|
tar -zxf "llama-swap_${LS_VER}_linux_${ARCH}.tar.gz" && \
|
||||||
|
rm "llama-swap_${LS_VER}_linux_${ARCH}.tar.gz"
|
||||||
|
|
||||||
COPY --chown=$UID:$GID config.example.yaml /app/config.yaml
|
COPY --chown=$UID:$GID config.example.yaml /app/config.yaml
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user