Docker & Wayland - it fail to work today

My script looking as follow:

docker run -d -e XDG_RUNTIME_DIR=/tmp -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISP
LAY "$@"

Problem is: when trying to
QT_QPA_PLATFORM=wayland my_program
Inside an container, I got:

libEGL warning: wayland-egl: could not open /dev/dri/renderD128 (No such file or directory)
Segmentation fault (core dumped)

It worked today.

Sorry - my BAD.

I assumed that is something broken inside docker, because when program starts segfault, I saw warning about not able to open device. In next step, I tries another wayland backend, like xcomposite-glx, etc. When trying another backend, I got segfault during program initialization.

I decided to debug, when running before error occurs. That was segfault in my code - sorry.

So, working as expected now?

FWIW, I found this stack overflow topic which included an informative answer that may be of value…

“Most drivers are implemented in Kernel space and has to be installed in host. But there are tools/utils needed to be installed to use some hardware that is in userspace, in these need to be installed in container. And using options --device or --privileged -v delegates the access and concurrent use of the hardware to the host kernel.”

Thanks.
It worked entire time, but I made a typo in my source code (when doing copy-paste of code) and I was scary because this message. I change Qt backend and it crash on other backends, so I thought something wrong was done by my image.
But I decided to debug program with QT_QPA_PLATFORM=wayland variable again and discovered source of evil.

PS: --device do not work. When I enter into container from terminal emulator, it quit. But that is for another topic.

Documentation…