1
0

llama-cli.Dockerfile 715 B

1234567891011121314151617181920212223242526272829
  1. ARG UBUNTU_VERSION=22.04
  2. FROM ubuntu:$UBUNTU_VERSION AS build
  3. RUN apt-get update && \
  4. apt-get install -y build-essential git cmake libcurl4-openssl-dev
  5. WORKDIR /app
  6. COPY . .
  7. RUN cmake -S . -B build -DGGML_BACKEND_DL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ALL_VARIANTS=ON -DLLAMA_CURL=ON -DCMAKE_BUILD_TYPE=Release && \
  8. cmake --build build -j $(nproc) && \
  9. mkdir -p /app/lib && \
  10. find build -name "*.so" -exec cp {} /app/lib/ \;
  11. FROM ubuntu:$UBUNTU_VERSION AS runtime
  12. WORKDIR /app
  13. RUN apt-get update && \
  14. apt-get install -y libcurl4-openssl-dev libgomp1 curl
  15. COPY --from=build /app/build/bin/llama-cli /app/
  16. COPY --from=build /app/lib/ /app/
  17. ENV LC_ALL=C.utf8
  18. ENTRYPOINT [ "/app/llama-cli" ]