muryshev commited on
Commit
a3febbe
·
verified ·
1 Parent(s): 9e482c8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -8
Dockerfile CHANGED
@@ -20,23 +20,28 @@ WORKDIR /build/llama.cpp
20
  RUN git checkout b3465
21
 
22
  ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
23
- ENV LLAMA_CUBLAS=1
 
24
 
 
25
  RUN mkdir build && \
26
- cd build && \
27
- cmake .. -DLLAMA_CUBLAS=ON && \
28
- cmake --build . --config Release
 
 
29
 
30
  FROM ${BASE_CUDA_RUN_CONTAINER} as runtime
31
  RUN apt-get update --fix-missing && \
32
- apt-get install -y --no-install-recommends wget && \
33
  rm -rf /var/lib/apt/lists/*
34
 
35
  WORKDIR /app
36
 
37
- # Copy the executable from the build stage
38
- COPY --from=build /build/llama.cpp/build/bin/server /app
39
- COPY --from=build /build/llama.cpp/examples/server/public /app/public
 
40
  COPY ./run.sh /app/run.sh
41
  WORKDIR /app
42
  EXPOSE 7867
 
20
  RUN git checkout b3465
21
 
22
  ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
23
+ # ENV LLAMA_CUBLAS=1
24
+ ENV GGML_CUDA=1
25
 
26
+ # Use the default CUDA archs if not specified
27
  RUN mkdir build && \
28
+ if [ "${CUDA_DOCKER_ARCH}" != "default" ]; then \
29
+ export CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CUDA_DOCKER_ARCH}"; \
30
+ fi && \
31
+ cmake -B build -DGGML_CUDA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
32
+ cmake --build build --config Release --target llama-server -j$(nproc)
33
 
34
  FROM ${BASE_CUDA_RUN_CONTAINER} as runtime
35
  RUN apt-get update --fix-missing && \
36
+ apt-get install -y --no-install-recommends wget libgomp1 libcurl4-openssl-dev && \
37
  rm -rf /var/lib/apt/lists/*
38
 
39
  WORKDIR /app
40
 
41
+ COPY --from=build /build/llama.cpp/build/ggml/src/libggml.so /app/libggml.so
42
+ COPY --from=build /build/llama.cpp/build/src/libllama.so /app/libllama.so
43
+ COPY --from=build /build/llama.cpp/build/bin/llama-server /app/server
44
+
45
  COPY ./run.sh /app/run.sh
46
  WORKDIR /app
47
  EXPOSE 7867