# Common-library builder, independent of robotics runtime images and teaching lab.
# Pin the Ubuntu release/digest and Conan API. APT/Python transitives are recorded
# in each bundle; this is not a claim of bit-for-bit reproducible image rebuilds.
FROM ubuntu:22.04@sha256:2edbbc5dc405e9612ba3584ce95480277e3eb374407b5505fe26f17df77c7dbc
ARG DEBIAN_FRONTEND=noninteractive
# CMake packages and Autotools packages (libxml2/libiconv) need both build systems.
# pkg-config is supplied by this image, not downloaded as an unbounded tool chain.
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
       build-essential cmake pkg-config autoconf automake libtool \
       python3 python3-venv ca-certificates patch xz-utils \
    && rm -rf /var/lib/apt/lists/* \
    && python3 -m venv /opt/conan-venv \
    && /opt/conan-venv/bin/pip install --no-cache-dir 'conan==2.15.0'
ENV PATH="/opt/conan-venv/bin:${PATH}" \
    LANG=C.UTF-8 LC_ALL=C.UTF-8 PYTHONDONTWRITEBYTECODE=1
RUN useradd --create-home --uid 1000 --shell /bin/bash builder
USER builder
WORKDIR /store
CMD ["bash"]
