llama-cli-musa.Dockerfile 975 B

12345678910111213141516171819202122232425262728293031
  1. ARG UBUNTU_VERSION=22.04
  2. # This needs to generally match the container host's environment.
  3. ARG MUSA_VERSION=rc3.1.0
  4. # Target the MUSA build image
  5. ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
  6. # Target the MUSA runtime image
  7. ARG BASE_MUSA_RUN_CONTAINER=mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
  8. FROM ${BASE_MUSA_DEV_CONTAINER} AS build
  9. RUN apt-get update && \
  10. apt-get install -y build-essential git cmake
  11. WORKDIR /app
  12. COPY . .
  13. RUN cmake -B build -DGGML_MUSA=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
  14. cmake --build build --config Release --target llama-cli -j$(nproc) && \
  15. mkdir -p /app/lib && \
  16. find build -name "*.so" -exec cp {} /app/lib \;
  17. FROM ${BASE_MUSA_RUN_CONTAINER} AS runtime
  18. RUN apt-get update && \
  19. apt-get install -y libgomp1
  20. COPY --from=build /app/lib/ /
  21. COPY --from=build /app/build/bin/llama-cli /llama-cli
  22. ENTRYPOINT [ "/llama-cli" ]