# Build distcc from source in a lightweight Ubuntu base
FROM ubuntu:22.04
# Non-interactive apt
ENV DEBIAN_FRONTEND=noninteractive
# Build dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
autoconf \
automake \
libtool \
pkg-config \
libpopt-dev \
zlib1g-dev \
ca-certificates \
python3 \
python3-dev \
python3-setuptools \
gdb \
&& rm -rf /var/lib/apt/lists/*
# Working directory for the source
WORKDIR /src
# Copy the repository contents
COPY . /src
# Prepare build system (autotools may be required to generate configure scripts)
RUN chmod +x autogen.sh && ./autogen.sh || true
# Configure, build and install
RUN ./configure --disable-pump-mode --prefix=/usr/local
RUN make -j$(nproc)
RUN make install
# Try to run tests; ignore failures to avoid hindering the image build
RUN make check || true
# Default to a shell so the container is usable when run interactively
CMD ["/bin/bash"]