Unsolved Qt non-interactive install in Docker file fails with QXcbConnection DISPLAY Error
-
I have a docker file that is doing a Qt 5.8 non-interactive install and I'm getting the following error:
Step 15/21 : ENV QT_VERSION_A=5.8
---> Using cache
---> 585508f8fb4e
Step 16/21 : ENV QT_VERSION_B=5.8.0
---> Using cache
---> 32eb654acb19
Step 17/21 : ENV QT_VERSION_SCRIPT=580
---> Using cache
---> 7be314d66824
Step 18/21 : RUN wget https://download.qt.io/archive/qt/${QT_VERSION_A}/${QT_VERSION_B}/qt-opensource-linux-x64-${QT_VERSION_B}.run
---> Using cache
---> b16f68a4774e
Step 19/21 : RUN chmod +x qt-opensource-linux-x64-${QT_VERSION_B}.run
---> Using cache
---> dcd41dd5c287
Step 20/21 : COPY qt-noninteractive.qs /qt-noninteractive.qs
---> Using cache
---> 72c46b2abe23
Step 21/21 : RUN ./qt-opensource-linux-x64-${QT_VERSION_B}.run --script qt-noninteractive.qs
---> Running in e75d96617513
QXcbConnection: Could not connect to display
Aborted (core dumped)I have tested this on a Ubuntu VM with a display and it works fine. Are there any workarounds?
Thanks,
Ankur
-
@anshah said in Qt non-interactive install in Docker file fails with QXcbConnection DISPLAY Error:
I have tested this on a Ubuntu VM with a display and it works fine. Are there any workarounds?
What about making the Docker container start X before you run the Qt installation?
-
Hi,
You can try setting the backend to offscreen through the environment variables.
-
@Pablo-J.-Rogina What command can I put in the docker container to start X?
-
@SGaist If you can give an example of how to set the backend to offscreen that would be great!
-
Hi
From here
https://www.ics.com/blog/qt-tips-and-tricks-part-1
(section QPA Back Ends )
i think you can set the environment variable QT_QPA_PLATFORM to offscreen