June 25, 2017

Can you run GUI apps on Docker? Should you even try? Those are questions few people are asking so far. But as Docker continues to become a leading app deployment platform, it may be time to start thinking about how Docker can support desktop GUI apps.

By “GUI app,” I mean one that has a graphical interface delivered through video rather than a web browser. Lots of Dockerized applications already make interfaces available inside a browser, but very few allow you to interact with an app through a protocol such as X11.

There are exceptions. Fábio Rehm shows how to make Firefox run inside a container using X11 forwarding so that users can interact with the browser graphically. Another option is to use VNC to make a video display from a containerized application accessible from outside the container.

Is Docker Useful for GUI Applications?

If you’ve read this far, you may be wondering, “What’s the point?”

If you use Docker, you almost certainly do so within the context of software development or data center deployment. The idea of using Docker to install and run GUI apps—which you’re much likelier to find on a desktop PC than on a server—likely seems foreign.

Fair enough. In some respects, it’s hard to see the value of Docker for desktop apps. One of the main selling points of Docker is that it allows you to deploy apps quickly in a distributed environment composed of servers, and to move the apps around as needed. On the desktop, cluster environments and app portability are not very important.

On the other hand, Docker could help solve some challenges associated with desktop apps. For example, it could enable truly platform-agnostic app packages. We’ve come a long way since the days when you had to compile your app from source to make it run on your system. But most installation packages available today are still tied to a particular Linux distribution or version of Windows. With Docker, it finally would be possible to have a single package format for installing a given application on any Linux or Windows system. (Of course, you’d still be subject to the limitation of not being able to run Dockerized Linux apps on a Windows system, and vice versa, but that is a separate issue.)

Docker and GUI apps for Windows Server

More important, GUI-enabled Docker apps are likely to become essential as Docker continues to grow within the Windows server world. As of September, Docker offers native support for Windows Server 2016. In the Windows server world, much more than in the Linux one, GUI interfaces are common for configuring and managing apps. For example, if you want to run the IIS web server inside Docker, it would be handy to be able to manage it graphically, since IIS was not really designed for CLI management. (Sure, you can do it, but if you’re a Windows admin, you probably don’t want to.)

The bottom line: If Docker is going to keep expanding into new niches, sooner or later it will need to offer more robust support for exporting video from containers in order to accommodate GUI apps. The existing evidence shows that this is certainly possible to do. But a more streamlined solution will be important, especially for Windows server admins who want to leverage Docker.

Christopher Tozzi

Christopher Tozzi has covered technology and business news for nearly a decade, specializing in open source, containers, big data, networking and security. He is currently Senior Editor and DevOps Analyst with Fixate.io and Sweetcode.io.

  • Shawn McCarthy

    I have been researching this the past few days. What did you mean by “The existing evidence shows that this is certainly possible to do.” ? What evidence?

  • Robert Szynal

    Jessie Frazelle (formerly of the docker core team, currently of Google) already solved this at the start of 2015.
    https://blog.jessfraz.com/post/docker-containers-on-the-desktop/
    TL;DR;
    Run the container with -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY to interact with the application on the X11 display you ran it on (Replace $DISPLAY with a specific display if needed) and to get sound add –device /dev/snd

  • Phil Atkinson

    With IIS running in a container I’ve found it’s easy enough to enable Remote IIS connections and connect to the container from your host machine using the IIS GUI.

  • Thanasis I.

    Containerization could come in handy in non server environments too. Deploying a windowed application for consumption from end users in a platform agnostic way could solve many compatibility issues. I’ve built a Windows desktop application that is deployed on thousands of end user machines ranging from Windows XP up to Windows 10. Countless times I have faced the problem of not being able to reproduce bugs. Most of the time it was because of broken Windows installations, corrupted system components, missing dependencies (that should be there but were removed for unknown reasons from the user’s machine) and so on…
    Running my application in a container could save me huge amounts of time and money.