GUI container on the Docker

Running a GUI application on any base OS like Linux, Windows would a piece of cake, but ever thought that we can launch the GUI application like Firefox etc. on a container like Docker ?

Well, it’s not that easy task. To launch GUI application we need to have a specific file named as “.X11” file which provides the display and other features to launch any GUI application. This file is available in /tmp/file_name folder.

Let’s go through this procedure step-by-step.

Step 1: Open command terminal in respective Operating system. Here I used RedHat-8 as my base OS. Now, we go inside the path -> /tmp/.X11-unix/

we can see “X0” and “X1024” files, it means that “.X11” is already present in my base OS.

Step 2: Launch a Docker container

We exit from container OS and enter to base OS. Then we copy the “.X11” file from base OS to container OS using following command (shown in below)

Using command ==> yum install firefox -y , we install firefox on container OS.

NOTE: warnings can be ignored

Successfully installed and launched Firefox on container OS.

This task is done as a part of summer training under my mentor Mr. Vimal Daga sir.

Thank you !!😊

I am Undergoing MlOps Training Under Mentorship of VimalDaga sir.