# A6(a) minimal-host build: a stock Ubuntu 26.04 with ONLY the packages from the captured configure log
# (../cmake_configure.log), then `uv sync --frozen` of the repro branch. A missing prerequisite fails the build.
#   docker build -t pherc0332-repro-env -f Dockerfile <dir containing a clone of branch pherc0332-repro-s1_f327 as villa/>
FROM ubuntu:26.04
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
      ca-certificates curl git \
      cmake ninja-build pkg-config g++ make \
      python3.14 python3.14-dev python3.14-venv \
      libsqlite3-dev libssl-dev nlohmann-json3-dev libzstd-dev libopencv-dev \
      libtiff-dev libcurl4-openssl-dev zlib1g-dev libblosc-dev \
    && rm -rf /var/lib/apt/lists/*
RUN curl -LsSf https://astral.sh/uv/0.13.1/install.sh | env UV_INSTALL_DIR=/usr/local/bin sh
COPY villa /src/villa
WORKDIR /src/villa/spiral-fitting
RUN uv sync --frozen -v > /src/uv_sync.log 2>&1 || { tail -40 /src/uv_sync.log; exit 1; }; grep -E '^DEBUG -- ' /src/uv_sync.log
RUN .venv/bin/python -c "import torch, vc_object_store, vc_spiral; print('ok', torch.__version__)" \
    && uv pip freeze --python .venv/bin/python > /src/pip_freeze_minimal.txt
