ccache-ccache
SUCCESS
4m 41s
History Source
SummaryIterations1Transcript3Dockerfile
01Iteration 1
WRITEWriteFile· step #1
1s
Dockerfile1201 bytes written
text44 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"]
WRITEWriteFile· step #2
0s
.dockerignore198 bytes written
dockerignore20 lines · 198 chars
# Ignore VCS
.git

# Build directories
build
CMakeFiles
CMakeCache.txt
cmake_install.cmake
Makefile
CTestTestfile.cmake
install

# System / editor junk
*.swp
*.swo
*.DS_Store

# Misc
testdir.tar.xz
VERIFYVerifyBuild· step #3
2m 40s
VerifyBuildaccepted
Concerns: The image installs Redis server and Redis tools which are unlikely needed for a standalone CLI tool and will increase image size., Symlinking all compilers to ccache is common, but ensure the underlying compilers are properly invoked by ccache in your CI environment.
Smoke [PASS]: command -v ccache
Smoke [PASS]: ccache --version
Smoke [PASS]: ccache --help | head -n 5