add ccache and cache mounts

This commit is contained in:
tooomm 2026-07-18 18:38:20 +02:00
parent 790e4093ef
commit 304dbcd9fa

View file

@ -5,6 +5,7 @@ ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ccache \
cmake \
ninja-build \
file \
@ -18,15 +19,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
qt6-tools-dev \
qt6-tools-dev-tools
ENV CCACHE_DIR=/root/.ccache
ENV CCACHE_MAXSIZE=550M
WORKDIR /src
COPY . .
RUN cmake -S . -B build \
-G Ninja \
-DWITH_SERVER=1 \
-DWITH_CLIENT=0 \
-DWITH_ORACLE=0 \
&& cmake --build build \
&& cmake --install build
RUN --mount=type=cache,target=/root/.ccache \
cmake -S . -B build \
-G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DWITH_SERVER=1 \
-DWITH_CLIENT=0 \
-DWITH_ORACLE=0 \
&& cmake --build build \
&& cmake --install build
RUN ccache --show-stats
# -------- Runtime Stage (clean) --------