FROM quay.io/fedora/fedora:43

ENV HOME=/tmp \
    XDG_RUNTIME_DIR=/tmp \
    PIP_NO_CACHE_DIR=1
WORKDIR /src
ENTRYPOINT ["/usr/bin/entrypoint.sh"]

RUN dnf -y --setopt=install_weak_deps=false install \
    make bats jq iproute podman openssl httpd-tools diffutils procps-ng \
    gcc cargo \
    $([ $(uname -m) == "x86_64" ] && echo ollama) \
    # for validate and unit-tests
    shellcheck \
    python3 python3-devel python3-pip \
    perl-Clone perl-FindBin && \
    dnf -y clean all
RUN rpm --restore shadow-utils

COPY container-images/bats/entrypoint.sh /usr/bin
COPY container-images/bats/containers.conf /etc/containers
COPY . /src
RUN make install-requirements
RUN chmod -R a+rw /src
RUN chmod a+rw /etc/subuid /etc/subgid
