@Giacomo_S I tried the image and was able to get it to work with this command:
xhost +
docker run --rm --interactive --env=DISPLAY=$DISPLAY --env=QT_X11_NO_MITSHM=1 --volume=/tmp/.X11-unix:/tmp/.X11-unix:rw sshipway/xclock
Also, be careful copy+pasting commands that contain quotation marks from the Internet. Sometimes the formatting can inadvertently change it from a straight quote character to a curly quote character.
Thanks @puneetse, this does not work for me.
I must be missing something…
See the attached screenshot.
Let me know if you need more detailed information about my Clear Linux installation.
Giacomo.
hi @Giacomo_S, do you see any difference on GNOME on X instead of Wayland or is the error the same? I am running Clear Linux version 29860 on an Intel NUC, and was able to launch the clock with your original command:
xhost +
docker run --rm -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix sshipway/xclock
But I’m running on X not Xwayland. Can you take a look at this StackExchange issue and see if it applies?
I take the opportunity to ask whether docker is the right tool for graphical applications or if there’s something more appropriate.
Thanks for helping solve this issue.
G.
Hello again Dear Clear Linux users and developers.
So, as to my topic, do you think docker is the appropriate tool to distribute graphical applications?
Is there something more tailored to this purpose?
I still haven’t solved the issue. If I am using docker out of its capabilities, I’ll have to find another solution, otherwise I will have to try another Linux distro to see if that configuration allows me to run graphical UIs from docker.
Thanks.
Can you check the output of sudo swupd bundle-list for containers-virt or cloud-native-basic? I’m wondering if your docker runtime is being defaulted to kata, which happens when those bundles are installed. Kata isolates containers inside lightweight VMs. If it is, you can try running the container with the --runtime=runc parameter to use the regular Docker runtime.
As to whether Docker is a good tool for distributing your graphical application, I think it depends a lot on your application and its requirements.
Thanks for sharing that output. It is helpful to know that you have containers-virt installed, which installs kata as the default runtime as I suspected.
Try adding the --runtime=runc earlier in the docker run command. I think it doesn’t get comprehended if it’s added after the docker image name. This command worked for me with containers-virt installed for example:
And/or, you can remove the containers-virt bundle to avoid the issue (sudo swupd bundle-remove containers-virt && sudo systemctl daemon-reload && sudo systemctl restart docker)
Thanks @puneetse! Your last suggestion did the trick!
Now one last thing to complete my question. In a previous message I asked whether docker is a good way to distribute a graphical application or not.
Actually, what I am distributing is an entire software framework to develop graphical applications for a control system. The docker image contains several layers of libraries (base control system libraries plus a multi threaded interface to the library plus qt control widgets plus Qt designer plugins and a bunch of graphical applications) and its sole purpose is to give the possibility to try the whole thing without installing all dependencies and environment.
Now that I’ve described what I use docker for, I think you can suggest me whether I am using docker properly or not.
I’ve removed the containers-virt bundle as well and now it is possible to run the xclock app without --runtime=runc (by the way, I’ve noticed there’s no trace of the --runtime option in `man docker run’ )
But why was the option necessary? Or, why was it necessary to remove containers-virt?
As you said, containers-virt run docker images in a more lightweight virtual machine. Doesn’t it provide accesso to X? Will it in the future? how much lighter is it compared to docker itself?
Thanks for solving my issue and for any forthcoming suggestion
containers-virt adds the kata container runtime and Clear Linux sets it as the default for docker. You can learn more about kata here: https://katacontainers.io . The VM isolation kata provides abstracts the host resources, like display, from the container.
I still think it’s something you’ll have to evaluate yourself and consider the environments your audience will be using. I’ve certainly seen things like IDEs and Web browsers packaged as images on Docker Hub.