Qt app UI elements randomly rendered as blank/black in Docker
-
wrote on 10 May 2019, 10:51 last edited by
I prepared Dockerfile to build Docker image of my Qt application. To run the application I use X - I enable access to X server
(xhost +local:root)
, then I use the following command to run it:docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" \ --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" mindforger:latest mindforger
The problem is that some Qt UI elements (menu items, dialogs, ...) are rendered blank in black (randomly) - check the screenshot below:
I'm on Ubuntu 16.04.5 with Docker 18.06 and Qt 5.01.
-
But... why? Why docker?
Anyway. Do other applications show normally? Like some standard Gnome/KDE apps.
I strongly recommend using something newer than Qt 5.0.1. It was an extremely buggy release. And it's super old.
-
wrote on 2 Jul 2020, 14:29 last edited by
I have the same with Ubuntu 16.04 on Docker and Qt Creator 4.5.2
-
@lduboeuf
Hi
Nothing we can do about it. Its a docker issue.Make sure you run a full Linux with X server etc inside the docker.
Then i had no issues running my app.If you use a special docker, it might have side effects as not operating like a normal OS would.
-
wrote on 22 May 2022, 12:25 last edited by
Geeva, was this ever solved?
I get the same problem with Qt 5.9.5, Ubuntu 18.04.6, GCC 7.5.0, Docker 20.10.14 -
@lduboeuf
Hi
Nothing we can do about it. Its a docker issue.Make sure you run a full Linux with X server etc inside the docker.
Then i had no issues running my app.If you use a special docker, it might have side effects as not operating like a normal OS would.
-
Geeva, was this ever solved?
I get the same problem with Qt 5.9.5, Ubuntu 18.04.6, GCC 7.5.0, Docker 20.10.14wrote on 14 Nov 2022, 07:09 last edited by@Kshepitzki I try to add --ipc host to the run command,and fix this issus; Here is the distilled run command that I used;
docker run --ipc host -e DISPLAY -e XAUTHORITY -h "$HOSTNAME" -u "$(id -u):$(id -g)" --device /dev/dri/card0 -v /dev/dri/card0:/dev/dri/card0 -v /tmp/.X11-unix:/tmp/.X11-unix -v "$XAUTHORITY:$XAUTHORITY" my-qt-app
-
@Kshepitzki I try to add --ipc host to the run command,and fix this issus; Here is the distilled run command that I used;
docker run --ipc host -e DISPLAY -e XAUTHORITY -h "$HOSTNAME" -u "$(id -u):$(id -g)" --device /dev/dri/card0 -v /dev/dri/card0:/dev/dri/card0 -v /tmp/.X11-unix:/tmp/.X11-unix -v "$XAUTHORITY:$XAUTHORITY" my-qt-app