'GUI Qt Application in a docker container

I try to run some Qt application in a docker container by mounting /tmp/.X11-unix. I saw here that can be difficult.

So when I run kdevelop in a docker container, it does not work (I get an empty window). But if I run qtcreator it's fine.

I think the difference is because of the Qt version used (kdevelop is developed with Qt4 and qtcreator with Qt5). All my other Qt5 applications work fine, but not a single Qt4 application.

Question:

Does anyone know what to do to launch a Qt4 application, without going a long way round like with vnc or ssh, just like this:

docker run -it -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix someQt4AppContainer

?



Solution 1:[1]

Try with :

export QT_QPA_PLATFORM=offscreen

This will make the shell variable visible to programs invoked from this shell.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bob Dalgleish