motif64

m64_c5c3570b99bb / Dockerfile

74 lines, 4.4 KBraw
1# opencode-*-strixhalo: opencode 1.18.23 with stock llama.cpp master 75d911f (llama-server and llama-bench built with2# the Vulkan backend, run on Mesa RADV) in one container, for AMD Strix Halo (Ryzen AI MAX+ 395, Radeon 8060S,3# gfx1151) on linux-x86_64. The llama.cpp stage and the runtime base are the pi17-*-strixhalo capsules' Dockerfile;4# the opencode part (version, offline settings, build-time warm-up) is opencode-qwen36-gb10's.5#6# Build stage: ubuntu:26.04 (Vulkan and SPIR-V headers, glslc, cmake from the archive), pinned by digest. The source is7# master's commit 75d911f, checked by SHA-256.8FROM ubuntu@sha256:2431ef40ba297198424288808116592542a461063c4abe97e2bbe048582b8d49 AS build9ENV DEBIAN_FRONTEND=noninteractive10RUN apt-get update \11 && apt-get install -y --no-install-recommends ca-certificates curl build-essential cmake libvulkan-dev glslc spirv-headers \12 && rm -rf /var/lib/apt/lists/*13ARG LLAMA_COMMIT=75d911fff3e880fda4d5eadb3bba22bcebbb729314ARG LLAMA_SHA256=ea40770ea12fc45ce9150fa2bb5526931ad45237a30ddef8ba4fad577bd36e5815RUN set -e; cd /tmp; \16    curl -fsSL -o src.tgz "https://github.com/ggml-org/llama.cpp/archive/$LLAMA_COMMIT.tar.gz"; \17    echo "$LLAMA_SHA256  src.tgz" | sha256sum -c -; \18    tar xzf src.tgz; mv "llama.cpp-$LLAMA_COMMIT" /src; rm src.tgz19WORKDIR /src20RUN cmake -B build -DCMAKE_BUILD_TYPE=Release \21      -DGGML_VULKAN=ON -DGGML_NATIVE=OFF \22      -DBUILD_SHARED_LIBS=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_EXAMPLES=OFF \23      -DLLAMA_BUILD_UI=OFF -DLLAMA_USE_PREBUILT_UI=OFF -DLLAMA_OPENSSL=OFF \24 && cmake --build build --config Release -j"$(nproc)" --target llama-server llama-bench \25 && mkdir -p /out/bin \26 && cp build/bin/llama-server build/bin/llama-bench /out/bin/ \27 && cp LICENSE /out/LICENSE.llama.cpp2829# Runtime: ubuntu:26.04 (amd64), pinned by digest, with Mesa's Vulkan drivers (RADV) and the loader.30# The GPU reaches the container as /dev/dri (render node); no ROCm and no /dev/kfd are needed.31FROM ubuntu@sha256:2431ef40ba297198424288808116592542a461063c4abe97e2bbe048582b8d4932ENV DEBIAN_FRONTEND=noninteractive33RUN apt-get update \34 && apt-get install -y --no-install-recommends ca-certificates curl libgomp1 libvulkan1 mesa-vulkan-drivers python3 \35 && rm -rf /var/lib/apt/lists/* /var/cache/apt/*36COPY --from=build /out/bin/ /opt/llama/bin/37COPY --from=build /out/LICENSE.llama.cpp /opt/llama/38ENV PYTHONUNBUFFERED=1 LANG=C.UTF-8 AMD_VULKAN_ICD=RADV39RUN ! ldd /opt/llama/bin/llama-server | grep 'not found'4041# The agent's tools (as gx10's agent images: git, ripgrep, jq, a C toolchain, Python 3).42RUN apt-get update -qq && apt-get install -y --no-install-recommends \43      git ripgrep jq xz-utils unzip file less procps build-essential python3-venv \44    && rm -rf /var/lib/apt/lists/*4546# Node 22.23.2 (the version of the node:22 image gx10's agents use), official x64 build,47# checked against nodejs.org's SHASUMS256.txt.48RUN curl -fsSL https://nodejs.org/dist/v22.23.2/node-v22.23.2-linux-x64.tar.xz -o /tmp/node.tar.xz \49 && echo "d60acfe00a2932254bb0ad20e01b0d74397a0875595de719654b214f4b03f307  /tmp/node.tar.xz" | sha256sum -c - \50 && mkdir -p /opt/node && tar xJf /tmp/node.tar.xz -C /opt/node --strip-components=1 && rm /tmp/node.tar.xz \51 && ln -s /opt/node/bin/node /opt/node/bin/npm /opt/node/bin/npx /usr/local/bin/52ENV PATH=/opt/node/bin:$PATH5354RUN npm install -g opencode-ai@1.18.23 && npm cache clean --force5556# Everything opencode would otherwise fetch at run time (models.dev catalogue, LSP servers,57# self-update) is disabled. The npm packages it installs on a project's first use are58# warmed here, where the build has network (warm_opencode.sh); start.sh copies them into59# the throwaway HOME.60ENV OPENCODE_DISABLE_AUTOUPDATE=1 \61    OPENCODE_DISABLE_LSP_DOWNLOAD=1 \62    OPENCODE_DISABLE_MODELS_FETCH=1 \63    OPENCODE_DISABLE_SHARE=164COPY opencode.json /etc/opencode/opencode.json65COPY warm_opencode.sh /tmp/warm_opencode.sh66RUN bash /tmp/warm_opencode.sh && rm /tmp/warm_opencode.sh6768# Gateway deps, the same pinned set as the other agent capsules' gateways.69RUN python3 -m venv /opt/gateway && /opt/gateway/bin/pip install --no-cache-dir \70      fastapi==0.115.14 uvicorn==0.32.1 httpx==0.28.1 \71      starlette==0.46.2 pydantic==2.14.1 pydantic_core==2.50.1 annotated-types==0.8.0 \72      typing_extensions==4.16.0 typing-inspection==0.4.4 anyio==4.15.1 idna==3.20 \73      certifi==2026.10.23 httpcore==1.0.9 h11==0.16.0 click==8.5.074WORKDIR /scratch