Launching and running Firefox i.e (GUI Application) on the top of docker container.
Docker is an open source project that makes it easy to create containers and container-based apps. Docker it is a container technology we can launch any os in just 1 sec .
🔰 Can we run GUI application on the top of docker container ?🤔
Yes we can ….
Actually we can’t launch GUI directly on the top of docker container like other OS e.g windows or linux. Even we can’t launch GUI or interact with GUI using simple run command.
Then how to launch GUI on the top of docker container ? 🤔
Answer of the above question is the intended practical which we are going to see in this blog.
🔰 In this blog we are going to see one interesting practical i.e how to launch GUI application on the top of docker container.
I am going to launch firefox on the top of docker container.🤩
🔶 Step 1 :- Configure docker on the top of base os. (In my case I am using RHEL8 as a base OS)
- Configure YUM for Docker (i.e create yum repository for docker )before installing the Docker Software in the VM. Follow the steps given below for configuring the YUM for docker.
Inside docker.repo file
Use “yum repolist” command to check whether the yum is configured successfully or not.
2. Now Install docker software using yum.
3. Now start the services of docker .
🔶 Step 2- Pull the image to launch the container. I am using centos image. (In my case image is already downloaded.)
- Now check image has downloaded or not
yes we can see that now centos image is present.
🔶 Step 3 :- Create separate workspace and create Dockerfile in that workspace.
Dockerfile is for creating new image.
- Dockerfile 👇
🔶 Step 4:- Then build the Docker Image and use “docker images” command for verifying whether the image is successfully created or not.
- Now check the image has created or not
we can see that image has created named firefox.
🔶 Create a Docker Container using firefox image with some environment variables. And as soon as we run the command given below, we will be landed to the firefox browser. 🤩
and we will be landed to firefox browser as shown below 👇
And finally we have launched GUI (firefox) on the top of docker container. 🤩