# Disposable image for live-verifying koan against a running Cobbler server. Runs its own
# libvirtd (needs /dev/kvm passed through) so VM state never touches the host's libvirt;
# without /dev/kvm it is client-only (see entrypoint.sh). Install koan from the
# bind-mounted repo with `pip install --no-deps`: the dependencies come from zypper, and
# pip would otherwise try (and fail) to compile libvirt-python.
# Not part of the packaged/CI image set under docker/rpms or docker/debs.
FROM opensuse/tumbleweed

RUN zypper --non-interactive refresh && \
    zypper --non-interactive install --no-recommends \
        python313 python313-pip \
        python313-libvirt-python \
        python313-distro python313-netifaces \
        git curl sudo \
        libvirt-daemon libvirt-daemon-qemu libvirt-client libvirt-daemon-config-network \
        qemu-kvm virt-install \
        iproute2 bridge-utils dnsmasq iptables \
        util-linux \
    && zypper clean --all

WORKDIR /koan

RUN pip install --break-system-packages pytest pytest-cov pytest-mock pyyaml

COPY docker/koan-virt/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
