2023-03-17 09:47:06 +00:00
|
|
|
ARG UBUNTU_VERSION=22.04
|
|
|
|
|
2024-07-17 18:21:55 +00:00
|
|
|
FROM ubuntu:$UBUNTU_VERSION AS build
|
2023-03-17 09:47:06 +00:00
|
|
|
|
|
|
|
RUN apt-get update && \
|
2024-12-04 13:45:40 +00:00
|
|
|
apt-get install -y build-essential git cmake libcurl4-openssl-dev
|
2023-03-17 09:47:06 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2024-12-04 13:45:40 +00:00
|
|
|
RUN cmake -S . -B build -DGGML_BACKEND_DL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ALL_VARIANTS=ON -DLLAMA_CURL=ON -DCMAKE_BUILD_TYPE=Release && \
|
|
|
|
cmake --build build -j $(nproc) && \
|
|
|
|
mkdir -p /app/lib && \
|
|
|
|
find build -name "*.so" -exec cp {} /app/lib/ \;
|
2023-03-17 09:47:06 +00:00
|
|
|
|
2024-07-17 18:21:55 +00:00
|
|
|
FROM ubuntu:$UBUNTU_VERSION AS runtime
|
2023-03-17 09:47:06 +00:00
|
|
|
|
2024-12-04 13:45:40 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
2024-06-06 05:17:21 +00:00
|
|
|
RUN apt-get update && \
|
2024-12-04 13:45:40 +00:00
|
|
|
apt-get install -y libcurl4-openssl-dev libgomp1 curl
|
2024-06-06 05:17:21 +00:00
|
|
|
|
2024-12-04 13:45:40 +00:00
|
|
|
COPY --from=build /app/build/bin/llama-cli /app/
|
|
|
|
COPY --from=build /app/lib/ /app/
|
2023-03-17 09:47:06 +00:00
|
|
|
|
2023-06-08 07:58:53 +00:00
|
|
|
ENV LC_ALL=C.utf8
|
|
|
|
|
2024-12-04 13:45:40 +00:00
|
|
|
ENTRYPOINT [ "/app/llama-cli" ]
|