ARG BASE_IMAGE=docker.io/library/ubuntu:22.04
FROM ${BASE_IMAGE}
ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
    build-essential debhelper devscripts fakeroot ca-certificates \
    python3 python3-tomli aspell aspell-en file procps
RUN useradd --create-home --shell /bin/sh builder
# Mount a verified native Rust 1.98.1 toolchain here, read-only. These are the
# real toolchain binaries, not rustup proxies or the host's glibc/compiler.
ENV PATH=/opt/gp-rust/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
COPY build-release.sh /usr/local/bin/gp-debian-build
ENTRYPOINT ["/bin/sh", "/usr/local/bin/gp-debian-build"]
