GUI Application inside docker

 GUI Application in docker container


Interface is a device or program that enables the user to communicate with the computer.

Graphical User Interface that allows users to interact with electronic devices through graphical icons and audio indicator 

Linux has Command Line Interface that processes commands to a computer program in the form of lines of text

So, this blog is about how we can launch application of GUI inside docker

Lets get started!

Step 1) We will first start our docker service and  check docker images



Step 2) We will pull centos:7 image

"docker pull centos:7"


and we will run a image through a container
"docker run -it --name container_name centos:7"
here os1 is the name of container.


Step 3)   Now we will install firefox
"yum install firefox "


As we run the command firefox it is showing an error that "no DISPLAY enviornment variable  specified"
to solve this error we have to specify enviornment


Step 4) Now we will make a directory 


Inside this file we will run firefox 
                    
Step 5) "docker build -t firefox ."
"-t" - Tag 
"."  -  is for current directory





firefox:latest 
has been successfully created

Step 6) 
"docker container run -it --env="DISPLAY" --net=host firefox"





We have successfully launched firefox in docker!

THANK YOU 😊😊





Comments

Post a Comment