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

Sanat Dash
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

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. ๐Ÿคฉ

Thank you for reading ..!