-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile-cpu
35 lines (23 loc) · 1014 Bytes
/
Dockerfile-cpu
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
31
32
33
34
35
FROM debian:12-slim AS env-build
WORKDIR /srv
# install build tools and clone and compile llama.cpp
RUN apt-get update && apt-get install -y make git cmake clang-16 libomp-16-dev
RUN git clone https://github.com/ggerganov/llama.cpp.git \
&& cd llama.cpp \
&& CC=clang-16 CXX=clang++-16 cmake -B build -DBUILD_SHARED_LIBS=off \
&& cmake --build build --config Release -j
FROM debian:12-slim AS env-deploy
# copy openmp libraries
ENV LD_LIBRARY_PATH=/usr/local/lib
COPY --from=0 /usr/lib/llvm-16/lib/libomp.so.5 ${LD_LIBRARY_PATH}/libomp.so.5
# copy llama.cpp binaries
COPY --from=0 /srv/llama.cpp/build/bin/llama-cli /usr/local/bin/llama-cli
COPY --from=0 /srv/llama.cpp/build/bin/llama-server /usr/local/bin/llama-server
# create llama user and set home directory
RUN useradd --system --create-home llama
USER llama
WORKDIR /home/llama
EXPOSE 8080
# copy and set entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh" ]