FROM ubuntu:22.04
# Non-interactive: do not set up timezone settings.
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies (including ninja for CMake builds) and Redis libs
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-multilib \
libhiredis-dev \
libzstd-dev \
python3 \
redis-server \
redis-tools \
ninja-build \
doxygen \
apt-transport-https \
ca-certificates \
curl \
&& rm -rf /var/lib/apt/lists/*
# Redirect all compilers to ccache for faster rebuilds
RUN for t in gcc g++ cc c++ clang clang++; do ln -vs /usr/bin/ccache /usr/local/bin/$t; done
# Copy source code and build within the container
WORKDIR /workspace
COPY . .
# Configure and build from source
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=CI -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
RUN cmake --build build --config CI
RUN cmake --build build --target install --config CI
# Start in a shell by default
CMD ["/bin/bash"]
Build timed out after 600s
# Multi-stage Dockerfile to build ccache from source on Ubuntu 22.04
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Essential build tools and dependencies. Keep the image light by avoiding runtime servers.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
asciidoctor \
bash \
build-essential \
cmake \
ninja-build \
clang \
python3 \
libhiredis-dev \
libzstd-dev \
elfutils \
docbook-xml \
docbook-xsl \
libedit2 \
curl \
llibcurl4 \
&& rm -rf /var/lib/apt/lists/*
# Work in a dedicated workspace and copy source
WORKDIR /workspace
COPY . .
# Configure build using Ninja for speed and disable heavy optional features
RUN cmake -S . -B build \
-G Ninja \
-D CMAKE_BUILD_TYPE=CI \
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D ENABLE_TESTING=OFF \
-D ENABLE_DOCUMENTATION=OFF \
-D REDIS_STORAGE_BACKEND=OFF \
-D HTTP_STORAGE_BACKEND=OFF
# Build the project (parallel)
RUN cmake --build build -j$(nproc)
# Final runtime image
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies that are needed by the built binary
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libhiredis-dev \
libzstd1 \
ca-certificates \
python3 \
tini \
&& rm -rf /var/lib/apt/lists/*
# Copy the built binary from the builder stage
COPY --from=builder /workspace/build/ccache /usr/local/bin/ccache
# Ensure the binary is executable
RUN chmod +x /usr/local/bin/ccache
# Default command: show version
CMD ["ccache", "--version"]
Concerns: Apt-get install line contains a likely typo: "llibcurl4" should be "libcurl4". This will cause the builder stage to fail during image build.
# Multi-stage Dockerfile to build ccache from source on Ubuntu 22.04
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Essential build tools and dependencies. Keep the image light by avoiding runtime servers.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
asciidoctor \
bash \
build-essential \
cmake \
ninja-build \
clang \
python3 \
libhiredis-dev \
libzstd-dev \
elfutils \
docbook-xml \
docbook-xsl \
libedit2 \
curl \
libcurl4 \
&& rm -rf /var/lib/apt/lists/*
# Work in a dedicated workspace and copy source
WORKDIR /workspace
COPY . .
# Configure build using Ninja for speed and disable heavy optional features
RUN cmake -S . -B build \
-G Ninja \
-D CMAKE_BUILD_TYPE=CI \
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D ENABLE_TESTING=OFF \
-D ENABLE_DOCUMENTATION=OFF \
-D REDIS_STORAGE_BACKEND=OFF \
-D HTTP_STORAGE_BACKEND=OFF
# Build the project (parallel)
RUN cmake --build build -j$(nproc)
# Final runtime image
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies that are needed by the built binary
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libhiredis-dev \
libzstd1 \
ca-certificates \
python3 \
tini \
&& rm -rf /var/lib/apt/lists/*
# Copy the built binary from the builder stage
COPY --from=builder /workspace/build/ccache /usr/local/bin/ccache
# Ensure the binary is executable
RUN chmod +x /usr/local/bin/ccache
# Default command: show version
CMD ["ccache", "--version"]
Concerns: The final runtime image installs libhiredis-dev (development package) which is unnecessary for runtime and bloats the image., There is no test suite or documented smoke script available in the container; exercising real functionality of a compiler-wrapper like ccache typically requires a compiler and a compilation workflow, which are not present in this final image., The build uses several cmake options (e.g., -D ENABLE_TESTING=OFF, -D ENABLE_DOCUMENTATION=OFF, -D REDIS_STORAGE_BACKEND=OFF, -D HTTP_STORAGE_BACKEND=OFF) that may not reflect the project’s default/supported options and could break in different environments., The CMD defaults to --version, which is a lightweight, non-functional smoke and does not verify end-to-end behavior of the artifact., There is a potential mismatch between builder and runtime dependencies (e.g., libzstd-dev in build vs libzstd1 in runtime) that could cause runtime issues.
# Multi-stage Dockerfile to build ccache from source on Ubuntu 22.04
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Essential build tools and dependencies. Keep the image lean by disabling heavy runtime servers.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
bash \
build-essential \
cmake \
ninja-build \
clang \
python3 \
libzstd-dev \
&& rm -rf /var/lib/apt/lists/*
# Work in a dedicated workspace and copy source
WORKDIR /workspace
COPY . .
# Configure build: disable optional storage backends to minimize runtime deps
RUN cmake -S . -B build \
-G Ninja \
-D CMAKE_BUILD_TYPE=CI \
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D REDIS_STORAGE_BACKEND=OFF \
-D HTTP_STORAGE_BACKEND=OFF \
-D ENABLE_TESTING=OFF \
-D ENABLE_DOCUMENTATION=OFF
# Build the project (parallel)
RUN cmake --build build -j$(nproc)
# Install the built artifacts to /usr/local
RUN cmake --install build --prefix /usr/local
# Final runtime image
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies needed by the built binary (if any)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libzstd1 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the built binary from the builder stage
COPY --from=builder /usr/local/bin/ccache /usr/local/bin/ccache
# Ensure the binary is executable
RUN chmod +x /usr/local/bin/ccache
# Default command: print version (smoke check)
CMD ["ccache", "--version"]
Build timed out after 600s
# Lightweight multi-stage Dockerfile to build ccache from source on Ubuntu 22.04
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install only the essential build tools and dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
bash \
build-essential \
cmake \
ninja-build \
clang \
python3 \
libhiredis-dev \
libzstd-dev \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
COPY . .
# Configure the build. Disable optional backends and docs to keep runtime dependencies minimal
RUN cmake -S . -B build \
-G Ninja \
-D CMAKE_BUILD_TYPE=CI \
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D ENABLE_TESTING=OFF \
-D ENABLE_DOCUMENTATION=OFF \
-D REDIS_STORAGE_BACKEND=OFF \
-D HTTP_STORAGE_BACKEND=OFF
# Build the project (parallel)
RUN cmake --build build -j$(nproc)
# Install the built artifacts to /usr/local
RUN cmake --install build --prefix /usr/local
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies (lightweight): provide basic runtime libraries
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libzstd1 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the built binary from the builder stage
COPY --from=builder /usr/local/bin/ccache /usr/local/bin/ccache
# Ensure the binary is executable
RUN chmod +x /usr/local/bin/ccache
# Default command: show version (smoke check)
CMD ["ccache", "--version"]
Build timed out after 600s
ARG BASE_IMAGE=ubuntu:22.04
FROM ${BASE_IMAGE} AS build
# Non-interactive: do not set up timezone settings.
ARG GCC_APT="gcc-multilib"
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_APT} \
gcc-12 \
g++-12 \
libhiredis-dev \
libzstd-dev \
python3 \
redis-server \
redis-tools \
&& rm -rf /var/lib/apt/lists/*
# Redirect all compilers to ccache.
RUN for t in gcc g++ cc c++ clang clang++; do ln -vs /usr/bin/ccache /usr/local/bin/$t; done
# Multi-stage Dockerfile to build ccache from source on Ubuntu 22.04
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and dependencies
ARG GCC_APT="gcc-multilib"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
asciidoctor \
bash \
build-essential \
ccache \
clang \
cmake \
docbook-xml \
docbook-xsl \
elfutils \
${GCC_APT} \
gcc-12 \
g++-12 \
libhiredis-dev \
libzstd-dev \
python3 \
redis-server \
redis-tools \
ninja-build \
&& rm -rf /var/lib/apt/lists/*
# Enable ccache by wrapping the compilers
RUN for t in gcc g++ cc c++ clang clang++; do ln -vs /usr/bin/ccache /usr/local/bin/$t; done
WORKDIR /src
COPY . .
# Configure build with CI-like settings and minimal optional backends
RUN cmake -S . -B build \
-DCMAKE_BUILD_TYPE=CI \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D REDIS_STORAGE_BACKEND=ON \
-D HTTP_STORAGE_BACKEND=ON \
-D ENABLE_TESTING=OFF \
-D ENABLE_DOCUMENTATION=OFF
# Build the project (parallel)
RUN cmake --build build -j$(nproc)
# Optional install step to /usr/local (for runtime convenience)
RUN cmake --install build --prefix /usr/local
# Final runtime image
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies (lightweight)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libzstd1 \
libhiredis0 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* || true
# Copy the built ccache binary from the builder stage
COPY --from=builder /usr/local/bin/ccache /usr/local/bin/ccache
# Ensure the binary is executable
RUN chmod +x /usr/local/bin/ccache
# Default command: show version (smoke check)
CMD ["ccache", "--version"]
Build timed out after 600s
# Lightweight multi-stage Dockerfile to build ccache from source on Ubuntu 22.04
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and minimal dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
bash \
build-essential \
cmake \
ninja-build \
clang \
python3 \
libzstd-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY . .
# Configure build with minimal backends and doc generation disabled
RUN cmake -S . -B build \
-G Ninja \
-D CMAKE_BUILD_TYPE=CI \
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D REDIS_STORAGE_BACKEND=OFF \
-D HTTP_STORAGE_BACKEND=OFF \
-D ENABLE_TESTING=OFF \
-D ENABLE_DOCUMENTATION=OFF
# Build the project (parallel)
RUN cmake --build build -j$(nproc)
# Install into /usr/local for runtime convenience
RUN cmake --install build --prefix /usr/local
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies (minimal)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libzstd1 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the built binary from the builder stage
COPY --from=builder /usr/local/bin/ccache /usr/local/bin/ccache
# Ensure the binary is executable
RUN chmod +x /usr/local/bin/ccache
# Default command: smoke check
CMD ["ccache", "--version"]
Build timed out after 600s
# Lightweight multi-stage Dockerfile to build ccache from source on Ubuntu 22.04
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and minimal dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
bash \
build-essential \
cmake \
ninja-build \
clang \
python3 \
libzstd-dev \
libhiredis-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
COPY . .
# Configure the build with minimal features to speed up and keep runtime lightweight
RUN cmake -S . -B build \
-G Ninja \
-D CMAKE_BUILD_TYPE=CI \
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D DEPS=LOCAL \
-D REDIS_STORAGE_BACKEND=OFF \
-D HTTP_STORAGE_BACKEND=OFF \
-D ENABLE_TESTING=OFF \
-D ENABLE_DOCUMENTATION=OFF
# Build the project (parallel)
RUN cmake --build build -j$(nproc)
# Install to /usr/local for runtime convenience
RUN cmake --install build --prefix /usr/local
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies (minimal)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libzstd1 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the built binary from the builder stage
COPY --from=builder /usr/local/bin/ccache /usr/local/bin/ccache
# Ensure the binary is executable
RUN chmod +x /usr/local/bin/ccache
# Default command: smoke check
CMD ["ccache", "--version"]
- Exact error message and exit code
- CMake Error at cmake/FindXxhash.cmake:34 (message):
Could not find Xxhash>=0.8.0
- Call Stack (most recent call first):
cmake/Dependencies.cmake:29 (find_package)
CMakeLists.txt:77 (include)
- -- Configuring incomplete, errors occurred!
- See also "/workspace/build/CMakeFiles/CMakeOutput.log".
- See also "/workspace/build/CMakeFiles/CMakeError.log".
- Exit code: 1
- Failing command/step
- RUN cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=CI -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D DEPS=LOCAL -D REDIS_STORAGE_BACKEND=OFF -D HTTP_STORAGE_BACKEND=OFF -D ENABLE_TESTING=OFF -D ENABLE_DOCUMENTATION=OFF
- Missing packages or files mentioned
- XXHash library not found: Xxhash>=0.8.0 (likely need libxxhash-dev or a similar XXHash package)
- Version mismatch information
- Compiler version shown during the build: The C and CXX compilers identified as GNU 11.4.0
- The failure is due to a missing library (XXHash) rather than a compiler/version mismatch.# Lightweight multi-stage Dockerfile to build ccache from source on Ubuntu 22.04
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and minimal dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
bash \
build-essential \
cmake \
ninja-build \
clang \
python3 \
libzstd-dev \
libhiredis-dev \
libxxhash-dev \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
COPY . .
# Configure the build with minimal features to speed up and keep runtime lightweight
RUN cmake -S . -B build \
-G Ninja \
-D CMAKE_BUILD_TYPE=CI \
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D ENABLE_TESTING=OFF \
-D ENABLE_DOCUMENTATION=OFF \
-D REDIS_STORAGE_BACKEND=OFF \
-D HTTP_STORAGE_BACKEND=OFF
# Build the project (parallel)
RUN cmake --build build -j$(nproc)
# Install the built artifacts to /usr/local
RUN cmake --install build --prefix /usr/local
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies (minimal)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libzstd1 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the built binary from the builder stage
COPY --from=builder /usr/local/bin/ccache /usr/local/bin/ccache
# Ensure the binary is executable
RUN chmod +x /usr/local/bin/ccache
# Default command: smoke check
CMD ["ccache", "--version"]
Build timed out after 600s
# Lightweight multi-stage Dockerfile to build ccache from source on Ubuntu 22.04
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential build tools and minimal dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
bash \
build-essential \
cmake \
ninja-build \
clang \
python3 \
git \
libzstd-dev \
libxxhash-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
COPY . .
# Configure the build with minimal features to speed up and keep runtime lightweight
RUN cmake -S . -B build \
-G Ninja \
-D CMAKE_BUILD_TYPE=CI \
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D ENABLE_TESTING=OFF \
-D ENABLE_DOCUMENTATION=OFF \
-D REDIS_STORAGE_BACKEND=OFF \
-D HTTP_STORAGE_BACKEND=OFF \
-D DEPS=LOCAL
# Build the project (parallel)
RUN cmake --build build -j$(nproc)
# Install the built artifacts to /usr/local
RUN cmake --install build --prefix /usr/local
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Runtime dependencies (minimal)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libzstd1 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the built binary from the builder stage
COPY --from=builder /usr/local/bin/ccache /usr/local/bin/ccache
# Ensure the binary is executable
RUN chmod +x /usr/local/bin/ccache
# Default command: smoke check
CMD ["ccache", "--version"]