GUI application launched inside docker container

Task Description 📄

Lets begin ……

First check whether the docker is installed or not using cmd :-

rpm -q docker-ce

If not installed then ,use yum install docker-ce — nobest -y to install docker on linux (docker host)

Now after installing

Check the status of docker service using cmd:-

systemctl status docker

If the docker service is inactive , then run cmd systemctl start docker to start docker service.

Now make a directory or workspace named with task2 or any name u want ..

use cmd :- mkdir /task2 to make directory

Now make Dockerfile using cmd :- vim Dockerfile

content of Dockerfile :-

This Dockerfile will create a image having firefox software already installed with it .And when we will launch the docker container using this image we will get firefox as starting software.

Now check docker images using cmd:- docker images

Execute Dockerfile to create our docker image use cmd :-

docker build -t image_name:version

Here I created the image name myfirefoximage with version v1

myfirefoximage with versionv1 successfully created

Can check our image using cmd :- docker images

Now its time to launch a container with gui application firefox in it

use cmd:-

docker run -it — name os_name — env=”DISPLAY” — net=host our_custome_image_name:version

Here

  • it : interactive terminal
  • name : give a name to container
  • env : it is used to say to our container that we are going to use the gui of our docker host
  • net : used to connect the docker container with network card of our docker host so that container can go out in outside world

Finally GUI appliaction launched in docker container

Thank for reading…..

#vimaldaga #righteducation #educationredefine #rightmentor #worldrecordholder #linuxworld #makingindiafutureready #righeducation #arthbylw #docker #container

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store