-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.llama.cpu
More file actions
30 lines (22 loc) · 980 Bytes
/
Dockerfile.llama.cpu
File metadata and controls
30 lines (22 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Dockerfile.llama.cpu
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential git cmake curl libcurl4-openssl-dev libssl-dev ca-certificates libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# Clone and build llama.cpp from source
RUN git clone https://github.com/ggerganov/llama.cpp.git /llama.cpp
WORKDIR /llama.cpp
# Use cmake for building
RUN cmake -B build -DLLAMA_CURL=ON -DLLAMA_OPENSSL=ON -DGGML_CUDA=OFF
RUN cmake --build build --config Release -j $(nproc)
# Create a non-root user and models directory
RUN useradd -m -s /bin/bash llamauser \
&& mkdir -p /models && chown -R llamauser:llamauser /models /llama.cpp
# Switch to the non-root user
USER llamauser
# Set working directory to the bin folder and ensure libraries are found
WORKDIR /llama.cpp/build/bin
ENV LD_LIBRARY_PATH=/llama.cpp/build/bin:$LD_LIBRARY_PATH
ENTRYPOINT ["./llama-server"]