1

Currently I'm building GUI applications for Linux and they have many dependencies( We ship Raspberry Pi devices with the executable installed on each device). My idea is to create a docker image for the executable and copy the image across all the devices instead of installing all the dependencies on each device and then install the application(The process takes about 6 hours). I assume shipping updates to the application this way is easy( deploy the updated image on docker hub).

Now that I want to run the GUI application from the container, is there a way I could just launch the GUI application the normal way(by double clicking.....)?

I would like to know if this is a right approach to what I want to achieve? If this is not the right approach, I would like to hear any other recommendations.

Edit: People who are down voting the question please mention the reason for down votes in the comments.

  • Why does it take six hours? If you're compiling the application (which, indeed, could possibly take a few hours for a very complex and large one) on each Raspberry Pi, you're doing it wrong. Just compile it once on a server, and then deploy the final files on every Raspberry Pi, reducing the deployment time to a few minutes. – Arseni Mourzenko Oct 13 '19 at 21:30
  • @ArseniMourzenko I mean it takes about 6 hours to install all the dependencies. For example wxWidgets alone takes about 1 hour. – pruthvidr Oct 14 '19 at 0:06
  • And What do you mean by GUI applications , are the Web Apps or native applications. Containers cannot serve native UI's , they can serve web applications running on top of embedded web servers. – Soumen Mukherjee Oct 14 '19 at 5:32
  • @SoumenMukherjee They can run X11 applications as long as you punch a hole back to the display server. – Chuck Adams Oct 14 '19 at 14:14
  • 1
    I assume the 1 hour "install" time is actually because you're building wxWidgets from source? Are you shipping the same model of Raspberry PI? If so, can you just build the application and its dependencies once and then copy them to each PI? – Matthew Oct 15 '19 at 15:01
1

This approach has two major drawbacks:

  1. Raspberry Pi is not really done with virtual machines or containers in mind. The goal of a Raspberry Pi, specifically, is to differentiate itself from servers. While servers are (1) expensive, (2) with lots of resources to allocate to virtual machines (or containers) and (3) with hardware optimized for virtualization, Raspberry Pi devices are cheap and intended to run applications barebone.

    It might be possible to run containers or even virtual machines. But it's not the right tool for the job.

  2. Containers are not the right tool for GUI applications.

    Here again, it might be possible to do it. Microsoft runs GUI applications on virtual machines for nearly a decade. But don't expect extensive documentation and “Do it easily in five minutes” tutorials, since not many persons are interested in the subject.

Since your problem seems to be the time it takes to build the application (including installing dependencies), I would suggest to perform the build on a server, and then copy the files to each Raspberry Pi.

If the build impacts only a given directory or a limited set of directories, this should be easy and straightforward.

If you don't know what could be impacted by the dependencies, it may be interesting to check LVM snapshots, more specifically to search if a snapshot from one machine can be applied to another one. Incremental backups could be another (possibly easier) solution, i.e. after every build, you create an incremental backup of the virtual machine that you restore on Raspberry Pi devices.

  • I think raspberry pi should be good enough to run containers. There are people who are already doing it. I think this website is a good reference for running docker on Raspberry Pi electromaker.io/tutorial/blog/…. I could have just built the application on a server and deployed it to the device I wanted but building the application requires me to first install many other libraries and drivers( wxWidgets, mongo driver, etc..). And I'll have to worry about installing the same version across all the devices. – pruthvidr Oct 15 '19 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.