module load inside rpmbuild inside docker


I wanted to bump the legion package to 19.04.0
(<a href="" title=""></a>), however for
some reason all tests segfault with openmpi
(<a href="" title=""></a>), so I
reported this upstream
(<a href="" title=""></a>) and included a
minimal dockerfile to reproduce this issue:

FROM fedora:rawhide
RUN dnf install -y spectool wget rpm-build dnf-plugins-core
RUN wget <a href="" title=""></a>
RUN spectool -g legion.spec
RUN dnf builddep -y legion.spec
RUN dnf install -y make
RUN rpmbuild -D"_sourcedir ${PWD}" -D"_srcrpmdir ${PWD}" -ba legion.spec

This worked fine on Thursday(?) to reproduce the failing tests in
%check, but now rpmbuild fails at an earlier stage with:
+ module load mpi/mpich-x86_64
++ /usr/share/lmod/lmod/libexec/lmod sh load mpi/mpich-x86_64
Lmod has detected the following error: The following module(s) are unknown:

If I jump into the container interactively (docker run -it ..
/bin/bash), "module load" as well as rpmbuild (and "module load"
inside) works.

If know this is a convoluted case, but any ideas how fix this?