FROM ubuntu:noble
ENV DEBIAN_FRONTEND=noninteractive
ENV SETUPTOOLS_SCM_PRETEND_VERSION_FOR_TEUTHOLOGY=0.0.0
ENV LANG=C.UTF-8
RUN apt-get update && \
    apt-get install -y \
    build-essential \
    git \
    qemu-utils \
    python3-dev \
    libssl-dev \
    ipmitool \
    pipx \
    vim \
    jq \
    curl \
    libev-dev \
    libvirt-dev \
    libffi-dev \
    libyaml-dev \
    locales \
    lsb-release && \
    apt-get clean all && \
    locale-gen $LC_ALL
WORKDIR /teuthology
COPY pyproject.toml requirements.yml uv.lock ansible.cfg bootstrap /teuthology/
RUN \
    cd /teuthology && \
    mkdir ../archive_dir && \
    mkdir log && \
    chmod +x /teuthology/bootstrap && \
    ./bootstrap
COPY . /teuthology
RUN \
    (git config -f ./.git/config --unset 'http.https://github.com/.extraheader' || true ) && \
    ./bootstrap
COPY containers/teuthology-dev/containerized_node.yaml /teuthology
COPY containers/teuthology-dev/.teuthology.yaml /root
COPY containers/teuthology-dev/teuthology.sh /
RUN \
    mkdir $HOME/.ssh && \
    touch $HOME/.ssh/id_rsa && \
    chmod 600 $HOME/.ssh/id_rsa && \
    echo "StrictHostKeyChecking=no" > $HOME/.ssh/config && \
    echo "UserKnownHostsFile=/dev/null" >> $HOME/.ssh/config
ENTRYPOINT ["/teuthology.sh"]
