# Drydock install smoke test — Ubuntu 24.04 LTS
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1

# Drydock needs Python 3.12+. Ubuntu 24.04 LTS ships 3.12 by default.
RUN apt-get update && apt-get install -y --no-install-recommends \
        python3 python3-pip python3-venv \
        git ca-certificates curl \
    && rm -rf /var/lib/apt/lists/*

# Drydock-cli uses Python 3.12+. We create a venv to avoid the
# Ubuntu 24.04 PEP-668 "externally-managed environment" error from
# system pip.
RUN python3 -m venv /opt/drydock-venv
ENV PATH=/opt/drydock-venv/bin:$PATH

# Container's pexpect needs a real TTY-like environment; install once
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
    && pip install --no-cache-dir pexpect

WORKDIR /work

# The smoke test script is bind-mounted at run time so we don't have to
# rebuild the image on every change.
ENV OS_LABEL=ubuntu

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