Docker GUI Task26

Docker GUI Task26

This article describe how we can launch GUI software on Docker.

Task Description

*GUI container* on the *Docker*

  • Launch a container on docker in?GUI mode?.
  • Run any GUI software (Firefox) on the container.

Lets begin...?

Step 1:- Create a dockerGui folder and in this folder create a file name as Dockerfile.

No alt text provided for this image

Step 2:- Below is the Dockerfile code to create a docker image which should have firefox installed.

FROM centos
RUN yum install firefox -y
CMD ["usr/bin/firefox"]        
No alt text provided for this image

Step 3:- Now?build?this Dockerfile to create a image using docker build command.

  • docker build -t .?<name>:<tag>

No alt text provided for this image
No alt text provided for this image

Now?image successfully created.?Just for cross verify can use below command.

  • docker images | grep?firefox

No alt text provided for this image

Step 4:- Running Firefox container in GUI mode

  • We know that if we start firefox container directly then it may show errors like below.

No alt text provided for this image

  • It clearly shows that if we want to run docker container of firefox then we need to pass?"DISPLAY"?as a?environment variable.?For passing the environment variable just check the help from below command.

       docker container run --help        

  • If you pass environment variable but again it might give errors like below

No alt text provided for this image

  • To resolve this above issue we need to pass one more option called?--net=host?because?--net=host?option is?used?to make the programs inside the Docker container look like they are running on the?host?itself, from the perspective of the network.?It?allows the container greater network access than?it?can normally get.

docker run -it --net=host --env="DISPLAY" firefox:<tag>        

So finally if you run above command. Application?( Firefox?) will launch inside docker container.

No alt text provided for this image

It will automatically start the firefox.

No alt text provided for this image
No alt text provided for this image

Thank






要查看或添加评论,请登录

Km Sulekha的更多文章

  • HotStar Case Study Task2

    HotStar Case Study Task2

    This article will describe the journey of Hotstar’s infrastructure from EC2 to Kubernetes. The journey about why, what,…

    1 条评论
  • Case Study of AWS SQS

    Case Study of AWS SQS

    In this article I am going to share what is Amazon SQS and industries use case of Amazon SQS. Amazon SQS Amazon Simple…

  • ARTH Task18

    ARTH Task18

    In this article we are going to explain how to we can configure WordPress on ec2 instances and connect this with Amazon…

  • Arth2020 Task17

    Arth2020 Task17

    In this article we are going to create chat program using python socket programming and Threading. Task Description…

    2 条评论
  • Create a setup so that you can ping google but not able to ping Facebook from same system Task13

    Create a setup so that you can ping google but not able to ping Facebook from same system Task13

    This article is to explain how we can create an interesting networking setup in which only we can reach to google but…

  • How big MNC's like Google , Amazon etc stores, manages and manipulate Thousands of Terabytpes of data with High Speed and High Efficiency Task-1

    How big MNC's like Google , Amazon etc stores, manages and manipulate Thousands of Terabytpes of data with High Speed and High Efficiency Task-1

    In a world where competition is intense, users will simply dump you, if your app slows down or freezes. So your…

  • Industries use case of AKS ?

    Industries use case of AKS ?

    Kubernetes is by far the most popular container orchestration tool, yet the complexities of managing the tool have led…

  • Ansible-Tower

    Ansible-Tower

    In this 3 hours of session we learn practical demo how industries are using Ansible-Tower and how it gives lots of…

  • Arth2020 task12

    Arth2020 task12

    This article is to explain how to configure a highly automated setup for Reverse proxy i.e Haproxy and update it's…

    5 条评论
  • How industries are solving challenges using Ansible

    How industries are solving challenges using Ansible

    Companies using Ansible We have data on 8,781 companies that use Ansible. The companies using Ansible are most often…

    2 条评论

社区洞察

其他会员也浏览了