Files
archy/docker/llama-server/Dockerfile
T
ssmithxandClaude Opus 5.5 b6e0b22388 build(routstr,llama-server): pin base images by multi-arch digest
ubuntu:24.04 and uv:python3.14-bookworm-slim are pinned to their index
digests, which include the exact amd64 images the candidates were built
from (rebuilt image IDs are identical) and the arm64 ones. A package test
keeps every FROM pinned. Also records the seventh slice in the ledger and
corrects the "Find sellers" wait to "up to about 30 seconds".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 15:42:47 +00:00

36 lines
1.9 KiB
Docker

# CPU-only development candidate. No model is bundled or downloaded.
# Every x86-64 CPU tier is built and the best one is loaded at startup, as
# upstream's cpu.Dockerfile does: a single AVX2 build dies with SIGILL on
# nodes (and VMs) without AVX.
# Base image pinned by multi-arch index digest (amd64 and arm64 included).
FROM docker.io/ubuntu:24.04@sha256:68ee22004a9109b44973313b02ff7b1de250f1de0f5ecb628d73f579aaff33ac AS build
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates git cmake make gcc-14 g++-14 \
&& rm -rf /var/lib/apt/lists/*
ENV CC=gcc-14 CXX=g++-14
WORKDIR /src
# llama.cpp b9860, immutable source revision.
RUN git init . \
&& git remote add origin https://github.com/ggml-org/llama.cpp.git \
&& git fetch --depth 1 origin fdb1db877c526ec90f668eca1b858da5dba85560 \
&& git checkout --detach FETCH_HEAD \
&& test "$(git rev-parse HEAD)" = fdb1db877c526ec90f668eca1b858da5dba85560 \
&& cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON \
-DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_UI=OFF -DLLAMA_USE_PREBUILT_UI=OFF \
-DLLAMA_OPENSSL=OFF \
&& cmake --build build -j2 --target llama-server \
$(cmake --build build --target help | grep -o 'ggml-cpu-[a-z0-9_]*' | sort -u) \
&& mkdir /out && cp build/bin/llama-server /out/ \
&& find build -name '*.so*' -exec cp -P {} /out/ \;
FROM docker.io/ubuntu:24.04@sha256:68ee22004a9109b44973313b02ff7b1de250f1de0f5ecb628d73f579aaff33ac
RUN apt-get update && apt-get install -y --no-install-recommends libgomp1 libstdc++6 curl \
&& rm -rf /var/lib/apt/lists/*
# Backends are discovered beside the executable.
COPY --from=build /out/ /opt/llama/
ENV LLAMA_ARG_HOST=0.0.0.0 LLAMA_ARG_PORT=8080 LD_LIBRARY_PATH=/opt/llama
WORKDIR /tmp
EXPOSE 8080
ENTRYPOINT ["/opt/llama/llama-server"]