ccache-ccache
SUCCESS
7m 20s
History Source
SummaryIterations1Transcript5Dockerfile
01Iteration 1
WRITEWriteFile· step #1
0s
Dockerfile1064 bytes written
text53 lines · 1064 chars
FROM ubuntu:24.04 AS builder

# Build dependencies
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
 && apt-get install -y --no-install-recommends \
    asciidoctor \
    bash \
    build-essential \
    ccache \
    clang \
    cmake \
    docbook-xml \
    docbook-xsl \
    elfutils \
    gcc-13 \
    g++-13 \
    g++-14 \
    libhiredis-dev \
    libzstd-dev \
    python3 \
    redis-server \
    redis-tools \
    ninja-build \
 && 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

WORKDIR /ccache

# Copy source code
COPY . .

# Configure and build
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF
RUN cmake --build build -j$(nproc)
RUN cmake --install build --prefix /install

FROM ubuntu:24.04

# Runtime image: include the built ccache binary
COPY --from=builder /install /install

# Ensure the binary is in PATH
ENV PATH="/install/bin:${PATH}"

WORKDIR /work

# Default command: show help
CMD ["ccache","--help"]
WRITEWriteFile· step #2
0s
.dockerignore79 bytes written
dockerignore6 lines · 79 chars
# Ignore version control and build artifacts
.git
**/.git
build
install
ccache*
VERIFYVerifyBuild· step #3
3m 12s
VerifyBuildsmoke_failed
Smoke [FAIL]: ccache --help
  Output: ccache: error while loading shared libraries: libhiredis.so.1.1.0: cannot open shared object file: No such file or directory

Smoke [PASS]: command -v ccache
Smoke [PASS]: ccache --help | head -n 1
WRITEWriteFile· step #4
0s
Dockerfile1255 bytes written
text60 lines · 1255 chars
FROM ubuntu:24.04 AS builder

# Build dependencies
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
 && apt-get install -y --no-install-recommends \
    asciidoctor \
    bash \
    build-essential \
    ccache \
    clang \
    cmake \
    docbook-xml \
    docbook-xsl \
    elfutils \
    gcc-13 \
    g++-13 \
    g++-14 \
    libhiredis-dev \
    libzstd-dev \
    python3 \
    redis-server \
    redis-tools \
    ninja-build \
 && 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

WORKDIR /ccache

# Copy source code
COPY . .

# Configure and build
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF
RUN cmake --build build -j$(nproc)
RUN cmake --install build --prefix /install

FROM ubuntu:24.04

# Runtime image: include the built ccache binary
COPY --from=builder /install /install

# Ensure the binary is in PATH
ENV PATH="/install/bin:${PATH}"

WORKDIR /work

# Install runtime dependencies for the built binary
RUN apt-get update \
 && apt-get install -y --no-install-recommends \
    libhiredis-dev \
    libzstd1 \
 && rm -rf /var/lib/apt/lists/*

# Default command: show help
CMD ["ccache","--help"]
VERIFYVerifyBuild· step #5
2m 24s
VerifyBuildaccepted
Concerns: Runtime image installs libhiredis-dev (development headers) instead of a runtime library package (e.g., libhiredis0/libhiredis5); this can bloat the image and may not be necessary at runtime., Builder stage installs redis-server and related tooling (redis-tools) which are not clearly needed for building or running the CLI tool; could be removed to reduce image size.
Smoke [PASS]: /install/bin/ccache --version
Smoke [PASS]: /install/bin/ccache --help
Smoke [PASS]: /install/bin/ccache -s