FROM quay.io/fedora/fedora:44

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

RUN dnf -y --setopt=install_weak_deps=false install \
    make podman openssl git-core \
    # for building python dependencies on ppc64le and s390x
    gcc rust cargo \
    $([ $(uname -m) == "x86_64" ] && echo ollama) \
    # for validate and unit-tests
    shellcheck golang \
    python3 python3-devel python3-pip \
    perl perl-Clone perl-FindBin && \
    dnf -y clean all
RUN rpm --restore shadow-utils

COPY container-images/e2e/entrypoint.sh /usr/bin
COPY container-images/e2e/containers.conf /etc/containers
COPY . /src
RUN make install-requirements && make -C docs install-tools && make clean
RUN chmod -R a+rw /src
RUN chmod a+rw /etc/subuid /etc/subgid
