llama-server-vulkan.Dockerfile 942 B

12345678910111213141516171819202122232425262728293031
  1. ARG UBUNTU_VERSION=jammy
  2. FROM ubuntu:$UBUNTU_VERSION AS build
  3. # Install build tools
  4. RUN apt update && apt install -y git build-essential cmake wget
  5. # Install Vulkan SDK and cURL
  6. RUN wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key add - && \
  7. wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list && \
  8. apt update -y && \
  9. apt-get install -y vulkan-sdk libcurl4-openssl-dev curl
  10. # Build it
  11. WORKDIR /app
  12. COPY . .
  13. RUN cmake -B build -DGGML_VULKAN=1 -DLLAMA_CURL=1 && \
  14. cmake --build build --config Release --target llama-server
  15. # Clean up
  16. WORKDIR /
  17. RUN cp /app/build/bin/llama-server /llama-server && \
  18. rm -rf /app
  19. ENV LC_ALL=C.utf8
  20. # Must be set to 0.0.0.0 so it can listen to requests from host machine
  21. ENV LLAMA_ARG_HOST=0.0.0.0
  22. HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
  23. ENTRYPOINT [ "/llama-server" ]