Dockerfile44 lines · 1201 chars FROM ubuntu:jammy-20260210.1
# Build and runtime image for ccache from source
ENV DEBIAN_FRONTEND=noninteractive
# Install build tools, dependencies and Ninja for CMake -GNinja builds
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
asciidoctor \
bash \
build-essential \
ccache \
clang \
cmake \
docbook-xml \
docbook-xsl \
elfutils \
gcc-12 \
g++-12 \
libhiredis-dev \
libzstd-dev \
python3 \
redis-server \
redis-tools \
ninja-build \
&& rm -rf /var/lib/apt/lists/*
# Redirect all compilers to ccache so builds reuse cached results
RUN for t in gcc g++ cc c++ clang clang++; do \
ln -vs /usr/bin/ccache /usr/local/bin/$t; \
done
# Copy source and build from source
WORKDIR /workspace
COPY . /workspace
# Configure and build using Ninja, then install system-wide
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=CI -GNinja \
&& cmake --build build -- -j$(nproc) \
&& cmake --install build
# Default to show help for ccache when container is run without args
CMD ["/usr/local/bin/ccache", "--help"]