-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run arbitrary application whose preferred display server, x11 or Wayland, is unknown #31
Comments
Currently all applications available will support X11. Some also support Wayland. All current Wayland compositors normally run Xwayland to support X11 applications, too. It will take some (or a lot of) years until Wayland compositors without Xwayland will be present as regular desktop environments. Currently only some developers will occasionally run a pure Wayland environment to test their applications. So far, an easy general solution that will work for some years and for 99,9% of use cases will be a pure X11 setup for docker containers. Example with x11docker:
Example without x11docker, as in https://unix.stackexchange.com/questions/330366/how-can-i-run-a-graphical-application-in-a-container-under-wayland :
If you are running a Wayland compositor like Gnome 3 or Sway, you can provide both Wayland and X11 access. With environment variable Example with x11docker:
Example without x11docker:
A bit special are QT5 applications (most of KDE). To use Wayland they need (Edit: I have removed the workaround with |
BTW, since it's possible without |
Sharing host display :0 is a security issue. Furthermore it provides some comfortable options, e.g. to use hardware acceleration and pulseaudio sound. A non obvious feature is dropping container capabilities to a bare minimum (compare Edit: For most cases you get improved isolation without missing application functionality with docker run options |
This is way off-topic, but would you happen to know how exactly I'm supposed to create simplest dockers with to persistently run apps like Google Chrome, Firefox and Steam? Previously I preferred LXC-based Canonical project, Libertine, but it's probably on track to deprecation since Wayland and GNOME Shell. I found these two for reference, sameersbn/browser-box:1.0.1-3 and Run Firefox or Google Chrome into a Docker container. but I don't understand what roles |
The browser-box does a lot of custom setup dispersed on several files, I don't want to go through all this. The firefox example is easier to understand. It creates a user x11docker does similar setups on its own. For many applications it is quite easy to set up valid docker images. x11docker cares for user creation itself. Example for midori browser:
Build with: Some applications need some custom setup. Example: wine is even more complicated to satisfy all dependencies. chromium needs option
Build image like midori example and run with |
Damn, that's more over the place than I was prepared for. How can I troubleshoot in case something doesn't work? Obviously I can't ask for your assistance every time something goes wrong. Like Also, for development purposes, I remember Python's |
Sure, you can ask. Just try out; as I said, most apps will run out of the box. You just picked some examples that are rather special. Build your images, run them, and if you are stuck, open a ticket and I'll look at that. Most times it makes sense to run x11docker with option Often the application itself will show usefull error messages. To get application output only, run with One approach of debugging is to run with options
I've not heard of it. I had a short look; it seems to set up something like a chroot environment. I cannot assess if that will work in docker. Just try out, open a ticket and report; maybe I'll have ideas if I see some error messages. Rather hard approaches of degrading container isolation for debugging is to allow all linux capabilities. It is not directly an x11docker option, but possible. You would need docker run option |
I've a couple of more unrelated questions:
|
I've never tried, and I doubt it would work. docker creates some files like Sharing folders from host is possible with option I would rather recommend to create an image based on the same system as your host. Then it should be possible to mount some systemhost folders/libraries into container. But rather ask someone else, I can only tell vaguely.
I don't really understand the question. nginx is often used in containers, but I've never used it. I don't know what it needs and how to set it up. If it needs additional privileges or group memberships, x11docker can add them. |
Can't we provide the root dir as copy-on-write image? As in, if it needs to touch the From what I understand, every time I run the container, it starts with a fresh root directory. Wouldn't that wipe out the document root with my HTML files? |
I really don't know. Though, it is an interesting approach to use the host as a base instead of an image. If you find out more about this, please tell me.
If you mount a directory from host to the HTML storage location, the HTML files will be preserved. docker also provides some sort of persistant data volume containers, but I did not investigate. I trust more in shared host directories. |
I'll close this ticket as the origin question is answered. In general, it's a good idea to open new tickets for new questions, may they big or small. It helps to find again topics later, and helps others who are looking through the issues. |
I am not sure, but |
Is there catch-all command to display the application regardless of the window system it uses or other attributes that may or may not be known to the user?
The text was updated successfully, but these errors were encountered: