Run Qt GUI application inside docker.
-
I personally did never run a gui application in docker yet. However, I know that you should pass your DISPLAY-Environment variable to docker with
-e
and as well provide your X11 socket as a shared volume using-v
. You will find tutorials around which show how to do so.For example (I did not read this article and cannot say whether its content will or will not help) https://medium.com/@SaravSun/running-gui-applications-inside-docker-containers-83d65c0db110
-
@devjb I know this possibility, but it won't work for me. I need to run my X server inside docker, I can't provide X11 socket as volume from host, cuz final host won't have GPU and X at all.
What I didn't say earlier is that I don't need any preview, this app have to do something with OpenGL in offscreen mode. I just need images that was created by this app. Byt thanks for your reply ! -
@dariusz-o said in Run Qt GUI application inside docker.:
final host won't have GPU
Just curious how you expect to have an X server running inside the Docker container if the host won't provide a graphical device...
No devices to configure. Configuration failed.
-
@Pablo-J-Rogina I think that it's possible to tell X server that there is fake monitor connected and for OpenGL usage I can use CPU through MESA drivers. I'm not 100% sure if it possible and if I understand it well. But just for now it seems legit for me.
-
@dariusz-o said in Run Qt GUI application inside docker.:
this app have to do something with OpenGL in offscreen mode.
Not sure why X server ended up being considered, when you goal is offscreen OpenGL.
Anyway, I guess you may want to consider QOffscreenSurface -
@Pablo-J-Rogina This app I want to run won't work without X, X are needed to create OpenGL context. In this case I have to adjust environment to app, not app to environment.
-
@dariusz-o said in Run Qt GUI application inside docker.:
X are needed to create OpenGL context
Not much expertise with graphic backends (X, OpenGL) but I do run Qt apps on RPi devices using fullscreen EGL without X server at all...
So again, IMO it looks like your X server requirement seems at odds with the OpenGL requirement at some extent
-
hi
What version of Qt do you use ?
After upgrading from 5.9 to 5.15 in Linux Mint
i had to do
sudo apt-get install --reinstall libxcb-xinerama0
to fix the error
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
when i tried to run Creator but not sure its the same as I didnt get
"qt.qpa.xcb: could not connect to display" -
@mrjj I'm using Qt 5.12.2
I managed how to connect fake display withXvfb :1 -screen 0 1024x768x16
.
This display works cuz I launchedglxgears
and I made screenshot withImageMagick
(gears were visable on it).After I connected this virtual display I don't get
"qt.qpa.xcb: could not connect to display"
anymore. So I'm one step closer.Now I'getting info like this
Got keys from plugin meta data ("xcb") loaded library "/home/user/app/platforms/libqxcb.so" loaded library "Xcursor" QFactoryLoader::QFactoryLoader() checking directory path "/home/user/app/platformthemes" ... QFactoryLoader::QFactoryLoader() checking directory path "/home/user/app/platforminputcontexts" ... QFactoryLoader::QFactoryLoader() checking directory path "/home/user/app/styles"
I got all those catalogs at
/opt/Qt/5.12.2/gcc_64/plugins/
and I added this path toLD_LIBRARY_PATH
I'm not sure why it suggests me that those catalogs are missed. -
@Pablo-J-Rogina But do your apps on RPi use OpenGL context, shaders, etc. ?
-
@dariusz-o said in Run Qt GUI application inside docker.:
But do your apps on RPi use OpenGL context, shaders, etc. ?
I really don't know...
-
Ok, setting virtual display with
Xvfb :1 -screen 0 1024x768x16 &
and setting variables:ENV QT_DEBUG_PLUGINS=1 ENV QT_QPA_PLATFORM=xcb ENV QT_QPA_PLATFORM_PLUGIN_PATH=/opt/Qt/${QT_VERSION}/gcc_64/plugins ENV QT_PLUGIN_PATH=/opt/Qt/${QT_VERSION}/gcc_64/plugins ENV DISPLAY=:1
solved everything!
It finally works ! :)Thanks for yours interest!