Running the images under rootless podman found two startup defects: - llama-server died with SIGILL on CPUs without AVX. Build every x86-64 CPU backend and load the best at runtime, as upstream's cpu.Dockerfile does. - Routstr's alembic script_location was cwd-relative while cwd is /data, so every start failed migrating. Anchor it to the ini with %(here)s. Ledger records the local Routstr -> llama-server paid completions against a fake-Lightning test mint, the mandatory pricing step, and the observed X-Cashu vs Bearer change/refund contract. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1.7 KiB
Docker
36 lines
1.7 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 digest qualification remains a release gate.
|
|
FROM docker.io/ubuntu:24.04 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
|
|
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"]
|