Sitemap

Launching and running Firefox i.e (GUI Application) on the top of docker container.

4 min readJan 13, 2022

🔰 Docker

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)

  1. 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

Press enter or click to view image in full size

Use “yum repolist” command to check whether the yum is configured successfully or not.

Press enter or click to view image in full size

2. Now Install docker software using yum.

Press enter or click to view image in full size

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.)

Press enter or click to view image in full size
  • 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 👇
Press enter or click to view image in full size

🔶 Step 4:- Then build the Docker Image and use “docker images” command for verifying whether the image is successfully created or not.

Press enter or click to view image in full size
  • Now check the image has created or not
Press enter or click to view image in full size

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. 🤩

Press enter or click to view image in full size

and we will be landed to firefox browser as shown below 👇

Press enter or click to view image in full size

And finally we have launched GUI (firefox) on the top of docker container. 🤩

Thank you for reading ..!

--

--

No responses yet