Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

Graphical Software within a Docker container

This project is a demo for running any program with a GUI from within a Docker container.

Docker normally doesn't handle the "X server", as for most "headless servers", and therefore fails at opening many GUI programs and crashes.

This demo is essentially based on this post (2013-07-08) on Docker by Robert Hashioka:

which led me to those links:

What it does

This Docker image enables to run GUI software without crashing, and more importantly enables to display the GUI as you could do between a remote host and your local machine (thinking of a Docker container similar to an headless server).

More precisely, these tools (Xpra, Xephyr, Fluxbox, Rox-filer) can let you remotely access your machine throught a Fluxbox GUI, via VNC (5900) and Xvfb independently from your 'normal' desktop GUI.

  • Xpra is a tool that allows to run X clients (e.g. graphical windows) usually on a remote host, and to direct their display to your local machine without "loosing any state" (i.e. it allows disconnection and reconnection without disrupting the forwarded application. It appears as a normal window on the localc desktop as opposed to VNC for example, and is managed by your local window manager.)
  • Xephyr is a display server implementing the X11 display server which targets a window (X client) on a host X server as its framebuffer.
    (How is it talking to/working with Xpra????)
    Xpra+Xephyr display the application (X client) running inside the container (i.e. seen as the host machine) with "recovery session capabilities" (i.e. ??? not crashing if disconnected, simply reconnecting from where it left).
  • Xvfb (X virtual framebuffer) is an in-memory display server for UNIX-like operating system. It allows to run graphical applications without a display while having the ability to take screenshots.
  • Fluxbox is a window manager for X. Therefore providing window manager capabilities (tabbing/grouping/keycommands/chainable keygrabber and editable menus).
  • Rox-filer is a graphical file manager for the X window system. It can be used as a small and fast filer with your (remote/virtual) desktop.

A drawing similar to this one should soon summarized the interactions between those tools.

Other interesting links

Getting started

Docker installation

easy: https://docs.docker.com/installation/

###

You can try the script outside Docker and check what it does:

$ python firefox.py

You should see Firefox opening the webpage, and when finished, printing HTML to your terminal.

Now running within Docker, you can see that:

$ sudo docker run -ti patrickmerlot/xvfb_demo
  • the page is loaded,
  • the HTML source printed,
  • but the Firefox GUI doesn't appear! At least the script can proceed without crashing.

Commands

To rebuild the Docker image:

$ sudo docker build --rm -t patrickmerlot/xvfb_demo .

Note: To run docker in detached mode (read this)

To run the app within Docker:

$ sudo docker run -ti patrickmerlot/xvfb_demo
Docker Pull Command
Owner
patrickmerlot
Source Repository

Comments (0)