From 255861c442ed4a0f1e4e797899d6207c85051ab8 Mon Sep 17 00:00:00 2001 From: Roberto Jose Etcheverry Romero <63941860+robertoetcheverryr@users.noreply.github.com> Date: Mon, 26 Oct 2026 18:19:35 +0100 Subject: [PATCH] docker: the root Dockerfile passes the source commit to the Terminal stage (#3644) .git is not in the build context, so package_terminal.py had no commit to put in the archive and the documented source build stopped. Ported from PR #3644 by robertoetcheverryr: ARG STRATA_COMMIT / ENV STRATA_BUILD_COMMIT as in docker/Dockerfile, and the two 'From source' commands in docs/DOCKER.md pass --build-arg STRATA_COMMIT=$(git rev-parse HEAD). Added: .dockerignore leaves out the folders docker/entrypoint.sh creates in a mounted data/ (install, state, home, Strata-data). A dangling data/install/third_party/llama.cpp link in a clone that had been mounted made the Terminal stage fail with a copytree error (seen in the review thread of #3644). Not built with docker here (no docker on this PC). --- .dockerignore | 5 +++++ Dockerfile | 2 ++ docs/DOCKER.md | 15 ++++++++------- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.dockerignore b/.dockerignore index 4f341af3..2550d9bf 100644 --- a/.dockerignore +++ b/.dockerignore @@ -17,6 +17,11 @@ __pycache__/ /mtp/ /models/ /Strata-data/ +# the folders docker/entrypoint.sh creates in a mounted data/ (a link to llama.cpp, the models, the keys): never part of a build (#3644) +/data/install/ +/data/state/ +/data/home/ +/data/Strata-data/ third_party/llama.cpp/ third_party/*.zip *.done diff --git a/Dockerfile b/Dockerfile index 82f096cf..eba34a01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -68,6 +68,8 @@ RUN set -e; \ # ---- 2. the Terminal (the release archive, built here) FROM ${RUNTIME_BASE} AS terminal +ARG STRATA_COMMIT= +ENV STRATA_BUILD_COMMIT=${STRATA_COMMIT} ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends python3 ca-certificates git && rm -rf /var/lib/apt/lists/* COPY . /src/ diff --git a/docs/DOCKER.md b/docs/DOCKER.md index 81672d74..3ea6f661 100644 --- a/docs/DOCKER.md +++ b/docs/DOCKER.md @@ -296,13 +296,14 @@ to the system or the graphics driver (`packaging/binary_deps.py`); finally it ch library inside the finished image. A package that fails any of these stops the build. Nothing is pushed anywhere. `docker/smoke-test.sh` runs the checks we ran on real cards (serves, key, chat, tool call, monitor, clean stop, memory freed, restart); see its first lines for the variables. -**From source.** `docker build -t strata:src .` in the repository compiles the CUDA 13 engine inside Docker, makes the package -and puts it in the same kind of image (`--build-arg CUDA_ARCHITECTURES=89` for one card only, much faster). For a GTX 10, P100 or -V100 build the CUDA 12 variant: `docker build -t strata:src-cuda12 --build-arg CUDA_IMAGE=nvidia/cuda:12.9.1-devel-ubuntu24.04 ---build-arg CUDA_ARCHITECTURES="60;61;70;75;80;86;89" --build-arg BUILD_VISION=0 .` (the build turns on the Pascal / Volta code by itself -when an architecture below 75 is listed, and names the package `cuda12` with driver 575.51). For AMD and Intel -builds from source see [AMD_HIP.md](AMD_HIP.md) and [INTEL.md](INTEL.md); then package the result with -`packaging/package_engine.py` and use `docker/build.sh`. +**From source.** `docker build -t strata:src --build-arg STRATA_COMMIT=$(git rev-parse HEAD) .` in the repository compiles the CUDA 13 +engine inside Docker, makes the package and puts it in the same kind of image (`--build-arg CUDA_ARCHITECTURES=89` for one card only, +much faster). `.git` is not copied into the build, so the commit comes in as `STRATA_COMMIT`; without it the Terminal stage stops. +For a GTX 10, P100 or V100 build the CUDA 12 variant: `docker build -t strata:src-cuda12 --build-arg STRATA_COMMIT=$(git rev-parse HEAD) +--build-arg CUDA_IMAGE=nvidia/cuda:12.9.1-devel-ubuntu24.04 --build-arg CUDA_ARCHITECTURES="60;61;70;75;80;86;89" --build-arg BUILD_VISION=0 .` +(the build turns on the Pascal / Volta code by itself when an architecture below 75 is listed, and names the package `cuda12` with +driver 575.51). For AMD and Intel builds from source see [AMD_HIP.md](AMD_HIP.md) and [INTEL.md](INTEL.md); then package the result +with `packaging/package_engine.py` and use `docker/build.sh`. ## Publishing the images (for maintainers)