llama-cli-musa.Dockerfile 980 B

123456789101112131415161718192021222324252627282930
  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. FROM ${BASE_MUSA_RUN_CONTAINER} AS runtime
  16. RUN apt-get update && \
  17. apt-get install -y libgomp1
  18. COPY --from=build /app/build/ggml/src/libggml.so /libggml.so
  19. COPY --from=build /app/build/src/libllama.so /libllama.so
  20. COPY --from=build /app/build/bin/llama-cli /llama-cli
  21. ENTRYPOINT [ "/llama-cli" ]