ARG DOCKER_TAG=rawhide
FROM registry.fedoraproject.org/fedora-minimal:$DOCKER_TAG

ARG REPO
ARG TIMESTAMP
ARG GITHASH
ARG VERSION

RUN echo install_weak_deps=false >> /etc/dnf/dnf.conf && \
    microdnf -y install --nodocs dnf5-plugins && \
    microdnf -y config-manager addrepo --overwrite --create-missing-dir --from-repofile=https://git.demus.dk/api/packages/demus/rpm/demus-${REPO}.repo && \
    microdnf -y copr enable demus/packages && \
    microdnf repo list && \
    microdnf -y remove python3-dnf && \
    microdnf -y --refresh upgrade && \
    microdnf -y install --nodocs rpm-build rpmautospec rpmdevtools git-core jq && \
    microdnf clean all && \
    rm -fR /usr/share/{zoneinfo,locale}

CMD [ "/bin/bash" ]

LABEL \
org.opencontainers.image.authors="Daniel Demus" \
org.opencontainers.image.created=${TIMESTAMP} \
org.opencontainers.image.description="Unofficial docker images used by act_runner to run workflows." \
org.opencontainers.image.documentation=https://git.demus.dk/demus/gitea-act-runner-images/src/branch/main/README.md \
org.opencontainers.image.licenses=GPL-3.0-or-later \
org.opencontainers.image.revision=${GITHASH} \
org.opencontainers.image.source=https://git.demus.dk/demus/gitea-act-runner-images \
org.opencontainers.image.title="Official Gitea Actions runner images" \
org.opencontainers.image.url=https://git.demus.dk/demus/gitea-act-runner-images \
org.opencontainers.image.vendor="Daniel Demus" \
org.opencontainers.image.version=v${VERSION}
