llama.cpp's llama-server on distroless: CPU, amd64 and arm64, non-root, no shell. Signed, SBOMs, VEX
310
llama.cpp's llama-server, built for the CPU, on a distroless base, for linux/amd64 and linux/arm64:
docker run --rm -p 127.0.0.1:8080:8080 -v "$PWD/models:/models:ro" \
--read-only --cap-drop ALL --security-opt no-new-privileges \
heyvaldemar/llama-server:latest -m /models/qwen2.5-0.5b-instruct-q4_k_m.gguf
It is a reference for what a supply chain for an AI runtime looks like when every claim can be checked by the person who reads it. The image has:
cc-debian13 plus the server and a small static health check. Non-root (uid 65532). It runs with a read-only root filesystem and no capabilities.v1.1.0, 17152752…), the base images by digest, the build tools by a dated snapshot of the Debian archive, the test model by sha256. The compile step runs with no network./health answers, and a small Apache-2.0 model, pinned by sha256, answers a question.1.2.3 are immutable on Docker Hub.Not affiliated with or endorsed by the llama.cpp project or ggml.org. This is a CPU image: no CUDA, ROCm, Vulkan or Metal.
Mount a GGUF model and point -m at it. The server listens on 0.0.0.0:8080 inside the container; publish it on the loopback, or put it behind a proxy that does TLS and authentication.
docker run -d --name llama -p 127.0.0.1:8080:8080 \
-v "$PWD/models:/models:ro" -v "$PWD/api-key:/run/api-key:ro" \
--read-only --cap-drop ALL --security-opt no-new-privileges --memory 4g --pids-limit 256 \
heyvaldemar/llama-server:latest \
-m /models/qwen2.5-0.5b-instruct-q4_k_m.gguf --ctx-size 4096 --api-key-file /run/api-key
curl http://127.0.0.1:8080/health
--api-key-file), never on the command line, where docker inspect and ps show it. /health stays open for the health check.-hf. The tests use Qwen2.5-0.5B-Instruct (Apache-2.0), pinned by revision and sha256 in tests/model.pins. Check a model's own licence before you use it.llama-server goes after the image name. --verbose shows which CPU variant was loaded.docker logs, or docker run --rm -it --pid container:llama --network container:llama <a debug image>.HEALTHCHECK in the image (/app/healthcheck) works without curl.Tags: 1.2.3 (immutable), 1.2, 1, latest, and llama-1.1.0, which follows the newest release built from that llama.cpp version.
Everything below runs on a machine that has nothing from this repository. Install cosign, slsa-verifier, grype and jq. The commands are the ones scripts/verify-release.sh runs on a fresh CI runner after every release, and a test fails if this page and the script disagree.
Name the release, and the three digests its tag points at:
IMAGE=heyvaldemar/llama-server
TAG=1.0.0
VERSION=v1.0.0
ISSUER=https://token.actions.githubusercontent.com
SOURCE=github.com/heyvaldemar/llama-server-docker
ID="https://github.com/heyvaldemar/llama-server-docker/.github/workflows/publish.yml@refs/tags/${VERSION}"
INDEX="$(docker buildx imagetools inspect "$IMAGE:$TAG" --format '{{.Manifest.Digest}}')"
AMD64="$(docker buildx imagetools inspect "$IMAGE:$TAG" --raw | jq -r '.manifests[] | select(.platform.architecture == "amd64") | .digest')"
ARM64="$(docker buildx imagetools inspect "$IMAGE:$TAG" --raw | jq -r '.manifests[] | select(.platform.architecture == "arm64") | .digest')"
The signature. It must verify as this repository's publish.yml on the release tag, and nothing else:
cosign verify "$IMAGE:$TAG" --certificate-identity "$ID" --certificate-oidc-issuer "$ISSUER"
The signature and the attestations on each architecture. The SBOMs (spdxjson, cyclonedx) and the VEX (openvex) are attestations signed by the same identity:
for DIGEST in "$AMD64" "$ARM64"; do
cosign verify "$IMAGE@$DIGEST" --certificate-identity "$ID" --certificate-oidc-issuer "$ISSUER"
for TYPE in spdxjson cyclonedx openvex; do
cosign verify-attestation "$IMAGE@$DIGEST" --type "$TYPE" --certificate-identity "$ID" --certificate-oidc-issuer "$ISSUER"
done
done
cosign verify-attestation "$IMAGE@$INDEX" --type openvex --certificate-identity "$ID" --certificate-oidc-issuer "$ISSUER"
The SLSA provenance. It must tie the image to this source repository and this tag:
slsa-verifier verify-image "$IMAGE@$INDEX" --source-uri "$SOURCE" --source-tag "$VERSION"
The SBOM and the VEX, and the scanner with and without the VEX. The VEX is a file you can take out of the attestation:
cosign verify-attestation "$IMAGE@$AMD64" --type openvex --certificate-identity "$ID" --certificate-oidc-issuer "$ISSUER" | jq -r '.payload' | base64 -d | jq '.predicate' > vex.openvex.json
grype "$IMAGE@$AMD64"
grype "$IMAGE@$AMD64" --vex vex.openvex.json
The first grype lists every finding in the image, including the ones in the distroless base. The second drops those the VEX says are not_affected; what is left is the list a person still has to read. The same with Docker Scout:
docker scout cves "$IMAGE@$AMD64" --vex-location vex.openvex.json
The SBOMs are also on each release as files. To read one from the registry, take .predicate out of the spdxjson or cyclonedx attestation the way the VEX is taken out above.
At the first build (2026-12-01, arm64) the scanner reported 56 findings in the image. The VEX gives 50 of them not_affected and the other 6 under_investigation. It is a statement about this image, not about Debian's packages in general:
not_affected status rests on either a claim the build checks on every image (for example, nothing under /app links OpenSSL, so the OpenSSL findings in the base do not apply) or a source review of one llama.cpp commit. See ADR 0004 and vex/.under_investigation. It stays that way until somebody has, and the VEX never says better.docker build -t llama-server .
scripts/test-server.sh llama-server
The second command downloads the test model (491 MB), checks its sha256, and runs the server tests. The Dockerfile cross-compiles: --platform linux/arm64 on an amd64 machine, or the other way round, does not use emulation.
To move llama.cpp, change LLAMA_CPP=<tag>:<commit> in the Dockerfile. The build refuses a tag that does not name that commit, and the source reviews in vex/decisions.json stop counting until they are made again.
Report a vulnerability privately: see SECURITY.md.
MIT for this repository. The image contains llama.cpp (MIT), whose licences are in /licenses, and a Debian-based distroless runtime.
Maintained by Vladimir Mikhalev · Docker Captain · CNCF Ambassador · IBM Champion · AWS Community Builder
docker pull heyvaldemar/llama-server:latest