# Drydock install smoke test — Rocky Linux 9 (RHEL 9 compatible)
FROM rockylinux/rockylinux:9

ENV PYTHONUNBUFFERED=1

# Rocky 9 ships Python 3.9. Drydock-cli requires 3.12+. Install
# python3.12 from the AppStream module.
RUN dnf install -y python3.12 python3.12-pip python3.12-devel \
        git ca-certificates curl \
    && dnf clean all

# Use the 3.12 binary explicitly and create a venv (similar pattern
# to Ubuntu 24.04's PEP-668 workaround — cleaner than relying on
# /usr/bin/python3 which still points at 3.9).
RUN python3.12 -m venv /opt/drydock-venv
ENV PATH=/opt/drydock-venv/bin:$PATH

RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
    && pip install --no-cache-dir pexpect

WORKDIR /work
ENV OS_LABEL=rocky

CMD ["python3", "/work/smoke_test.py"]
