llama-server-intel.Dockerfile 1019 Bytes
Newer Older
xuxzh1's avatar
update  
xuxzh1 committed
1
ARG ONEAPI_VERSION=2025.0.0-0-devel-ubuntu22.04
xuxzh1's avatar
init  
xuxzh1 committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

FROM intel/oneapi-basekit:$ONEAPI_VERSION AS build

ARG GGML_SYCL_F16=OFF
RUN apt-get update && \
    apt-get install -y git libcurl4-openssl-dev

WORKDIR /app

COPY . .

RUN if [ "${GGML_SYCL_F16}" = "ON" ]; then \
        echo "GGML_SYCL_F16 is set" && \
        export OPT_SYCL_F16="-DGGML_SYCL_F16=ON"; \
    fi && \
    echo "Building with dynamic libs" && \
xuxzh1's avatar
update  
xuxzh1 committed
18
    cmake -B build -DGGML_NATIVE=OFF -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_CURL=ON ${OPT_SYCL_F16} && \
xuxzh1's avatar
init  
xuxzh1 committed
19
20
21
22
23
24
25
26
27
28
    cmake --build build --config Release --target llama-server

FROM intel/oneapi-basekit:$ONEAPI_VERSION AS runtime

RUN apt-get update && \
    apt-get install -y libcurl4-openssl-dev curl

COPY --from=build /app/build/bin/llama-server /llama-server

ENV LC_ALL=C.utf8
xuxzh1's avatar
update  
xuxzh1 committed
29
30
# Must be set to 0.0.0.0 so it can listen to requests from host machine
ENV LLAMA_ARG_HOST=0.0.0.0
xuxzh1's avatar
init  
xuxzh1 committed
31
32
33
34

HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]

ENTRYPOINT [ "/llama-server" ]