server-cuda.Dockerfile 899 B

12345678910111213141516171819202122232425262728293031323334353637
  1. ARG UBUNTU_VERSION=22.04
  2. # This needs to generally match the container host's environment.
  3. ARG CUDA_VERSION=11.7.1
  4. # Target the CUDA build image
  5. ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
  6. # Target the CUDA runtime image
  7. ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
  8. FROM ${BASE_CUDA_DEV_CONTAINER} as build
  9. # Unless otherwise specified, we make a fat build.
  10. ARG CUDA_DOCKER_ARCH=all
  11. RUN apt-get update && \
  12. apt-get install -y build-essential git libcurl4-openssl-dev
  13. WORKDIR /app
  14. COPY . .
  15. # Set nvcc architecture
  16. ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
  17. # Enable CUDA
  18. ENV LLAMA_CUDA=1
  19. # Enable cURL
  20. ENV LLAMA_CURL=1
  21. RUN make
  22. FROM ${BASE_CUDA_RUN_CONTAINER} as runtime
  23. RUN apt-get update && \
  24. apt-get install -y libcurl4-openssl-dev
  25. COPY --from=build /app/server /server
  26. ENTRYPOINT [ "/server" ]