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 \ RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \ build-essential \
ccache \
cmake \ cmake \
ninja-build \ ninja-build \
file \ file \
@ -18,16 +19,23 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
qt6-tools-dev \ qt6-tools-dev \
qt6-tools-dev-tools qt6-tools-dev-tools
ENV CCACHE_DIR=/root/.ccache
ENV CCACHE_MAXSIZE=550M
WORKDIR /src WORKDIR /src
COPY . . COPY . .
RUN cmake -S . -B build \ RUN --mount=type=cache,target=/root/.ccache \
cmake -S . -B build \
-G Ninja \ -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DWITH_SERVER=1 \ -DWITH_SERVER=1 \
-DWITH_CLIENT=0 \ -DWITH_CLIENT=0 \
-DWITH_ORACLE=0 \ -DWITH_ORACLE=0 \
&& cmake --build build \ && cmake --build build \
&& cmake --install build && cmake --install build
RUN ccache --show-stats
# -------- Runtime Stage (clean) -------- # -------- Runtime Stage (clean) --------
FROM ubuntu:26.04 FROM ubuntu:26.04