GUI Application using Docker container.
Hello, Everybody
Today we are going to perform and interesting handson we all know Docker it is a container technology we can launch any os in just 1 sec .
Their is one thing which we cant to directly on container for eg:- we can not launch GUI application on container directly like other OS or normally windows or linux .
So today we are going to launch the GUI application through container OS.
Task Description ??
?? GUI container on the Docker
?? Launch a container on docker in GUI mode
?? Run any GUI software on the container
So lets Begin,
Step 1:- We need to configure docker in our os here I am using Redhat so need to configure Repo of redhat for Docker can configure it in /etc/yum.repos.d and create a file in docker-ce.
Step 2:- After configuration of repo we start the service using command
# systemctl start docker
Step 3:- After activation of service we can check the image present in our docker container and lets pull the Centos image from the below command
#docker ps --- running os #docker images ---images present in os #docker pull centos:latest --- to pull centos image from docker hub
Step 4:- After pulling the image lets create the Docker file in a workspace
Step 5:- Lets create image using the Docker file using the command
#docker build -t nameforimage .
Here (.) means take the file from current folder
Step 6:- Lets check whether imlaunchedched or not using command
docker images | grep image name
Step 7:- lets launch the firefox using the image using command
#docker run -it --name <name for os> --env DISPLAY --net host <imagename>
As you can see the firefox is launch similarly we can use other GUI application like gedit .