FROM registry.fedoraproject.org/fedora RUN dnf install -y rpm-build 'dnf-command(builddep)' WORKDIR /src COPY mod_authnz_pam.spec . RUN dnf builddep -y mod_authnz_pam.spec COPY * source/ RUN rpm -q --qf '%{name}-%{version}\n' --specfile mod_authnz_pam.spec | head -1 > name_version RUN mv -v source $( cat name_version ) RUN mkdir -p ~/rpmbuild/SOURCES RUN tar cvzf ~/rpmbuild/SOURCES/$( cat name_version ).tar.gz $( cat name_version ) RUN rpmbuild -bb --define "dist $( rpm --eval '%{dist}' ).localbuild" mod_authnz_pam.spec RUN dnf install -y ~/rpmbuild/RPMS/*/$( cat name_version )-*.localbuild.*.rpm