GUI container on the Docker
Task description
🔅 Launch a container on docker in GUI mode
🔅 Run any GUI software on the container
Why to launch GUI container on docker
We will be launching the Firefox application which requires the GUI console to be launched but the problem is Docker does not provide the GUI environment, It only provides CLI
So we can use our Host-O.S/Base O.S in our case it is RHEL8 as a server allowing us to use its Display Environment.
Step-1:
Creating a docker file
Installing xhost program at build time .
>>Xhost : The xhost command adds or deletes host names on the list of machines from which the X Server accepts connections.
>>We will be using The X server: it is an application that interacts with client applications via the X11 protocol to draw things on a display and to send input events like mouse movements, clicks, and keystrokes. Typically, one would start an X server which will wait for clients applications to connect to it. The applications will send a stream of commands telling the X server what to draw on the display and letting the client applications know if there’s input events that they should handle. The X server keeps track of what elements in the display belong to which application, manages the layering of images, etc.
Step-2:
Building a Docker Image using Dockerfile
Running the docker file and tagging the container with my_gui5 as it’s name.
Step-3:
Enabling Few things
Checking our Default value of Environment variable, and Enabling Xhost for all the users.
Step-4:
Finally running the command
Step-5:
Now we can see the firefox running.