Error building VTK with Qt support in (Ubuntu) Docker container

I’m trying to build VTK in an ubuntu:focal-based Docker container with Qt support. Here’s a link to the Dockerfile. The build configuration runs smoothly but I get the following error at the very end of make:

[100%] Linking CXX shared library ../../lib/
[100%] Linking CXX shared module ../../../lib/qml/VTK.9.1/
[100%] Built target ViewsQt
Generating qmltypes file using qmlplugindump
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QQmlComponent: Component is not ready
make[2]: *** [GUISupport/QtQuick/qml/CMakeFiles/qmlvtkplugin.dir/build.make:135: lib/qml/VTK.9.1/] Error 3
make[2]: *** Deleting file 'lib/qml/VTK.9.1/'
make[1]: *** [CMakeFiles/Makefile2:12297: GUISupport/QtQuick/qml/CMakeFiles/qmlvtkplugin.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I’m really not an expert here. Any idea about the origin? How can I circumvent this?

Qt is very tight-lipped about what is actually going wrong here. Usually it means that the QML plugin isn’t built properly (or its metadata is wrong). This usually also only shows up with incremental builds. Does removing the lib/qml directory, rerunning cmake and building help?

Thanks for the feedback! Unfortunately, what you suggested did not fix it. Since it’s a Docker container I never do incremental builds.