How to containerize a GUI app on top of ubi8 base images

Latest response

I would love to figure out how to do this for the reasons described in this article:

https://medium.com/@SaravSun/running-gui-applications-inside-docker-containers-83d65c0db110

To summarize, using RHEL8, I would like to create container images containing ready to go development environments, including GUI apps (e.g. Visual Studio Code) and then figure out how to remote the GUI to the container host. But I cannot figure out what and how to install necessary prereqs onto the image with buildah.

Responses

Hi Bern,

The main problem is that there are no repositories enabled in the UBI base images ... which would let you pull in all necessary dependencies automatically. If I'm not wrong, you can create a new container that you can register to RHSM and then enable repositories. I didn't test it, but it should also be possible to enable CentOS repositories, which means that you don't have to register the system within the container to RHSM. Alternatively you can simulate the installation of the GUI applications on
your host system, download the packages manually, and copy them into the container using podman cp - afterwards launch
the container and install the GUI applications and the matching dependencies manually. Hope these thoughts are useful. :)

Note : What I wrote about enabled repositories is valid for hosts not running RHEL, but rather something like fedora.
If you're running RHEL 8, you can make use of RHEL 8 repositories, if running RHEL 7, you can make use of RHEL 7
repositories. You should use the UBI 7 image in this case. Eventually 7 is needed to install the GUI application you've
mentioned, necessary dependencies might rely on that. RHEL 8 / UBI 8 is still very new, take this into consideration.

Regards,
Christian

I looked at registry.access.redhat.com/ubi8/ubi-minimal:latest on docker (on Fedora 30) and it does have (publicly accessible) ubi8 repositories enabled for BaseOS and AppStream. However these are cut down versions of the full RHEL8 repositories so they may not contain the desired packages.

Hi Michael,

Yes, exactly ... and let me add that the versions of these packages are the versions being current on the day the
UBI image was created. So if newer versions are required, you only can get them when the container is running
on a registered RHEL host. :)

Regards,
Christian