@@ -3,24 +3,38 @@ ARG DEBIAN_VERSION=12
33
44FROM gcc:${GCC_VERSION} AS build
55
6- RUN apt update && \
6+ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
7+ --mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
8+ apt update -y && \
79 apt upgrade -y && \
8- apt install -y git cmake libcurl4-openssl-dev libopenblas-openmp-dev
10+ apt install -y --no-install-recommends \
11+ git cmake ccache ninja-build \
12+ libcurl4-openssl-dev libopenblas-openmp-dev && \
13+ rm -rf /var/lib/apt/lists/*
914
1015WORKDIR /app
11- COPY . .
16+ COPY CMakeLists.txt .
17+ COPY CMakePresets.json .
1218
1319RUN --mount=type=cache,target=/root/.ccache \
14- cmake -S . -B build \
20+ --mount=type=cache,target=/app/build \
21+ cmake -S . -B build -G Ninja \
1522 -DCMAKE_BUILD_TYPE=Release \
23+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
24+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
1625 -DLLAMA_BUILD_TESTS=OFF \
1726 -DGGML_NATIVE=OFF \
1827 -DGGML_BACKEND_DL=ON \
1928 -DGGML_CPU_ALL_VARIANTS=OFF \
2029 -DGGML_BLAS=ON \
21- -DGGML_BLAS_VENDOR=OpenBLAS \
22- && cmake --build build --config Release -j $(nproc) \
23- && cmake --install build --prefix /opt/llama.cpp
30+ -DGGML_BLAS_VENDOR=OpenBLAS
31+
32+ COPY . .
33+
34+ RUN --mount=type=cache,target=/root/.ccache \
35+ --mount=type=cache,target=/app/build \
36+ cmake --build build --config Release -j $(nproc) && \
37+ cmake --install build --prefix /opt/llama.cpp
2438
2539# TODO: DOUBLE CHECK ALL FILES ARE COPIED INTO COLLECTOR
2640RUN cp *.py /opt/llama.cpp \
0 commit comments