FROM debian:12.11
ARG U_NAME="user"
ARG U_ID="1000"
RUN adduser --disabled-password --gecos '' --uid ${U_ID} ${U_NAME}
RUN apt-get update && apt-get install -y \
git \
cmake g++ \
libcurl4-openssl-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /home/${U_NAME}
USER ${U_NAME}
RUN \
git clone https://github.com/ggml-org/llama.cpp && \
cd llama.cpp && \
cmake -B build && \
cmake --build build --config Release -j 4
WORKDIR /home/${U_NAME}/llama.cpp/build/bin