How to Run GUI App on Docker | Technical EJ - Latest Technology News

Thursday 8 April 2021

How to Run GUI App on Docker

  Ekansh Jain       Thursday 8 April 2021

Hello Everyone, today I am going to explain to you how to run the Firefox application on top of Docker.


 

Follow the steps to run firefox(GUI App) on the top of docker:-

1) Create a Dockerfile that consist firefox as an application

Instructions used:-

  • FROM centos:8
  • RUN yum install firefox -y
  • CMD firefox 


2) Now, build the image, so that using this image, we can simply launch the GUI application directly

command:  docker build -t techyboy987/firefox-docker:v1 .


3) Now, run the container using the above-created image.

Command: docker run -it --net=host -e DISPLAY -v /tmp/.X11-unix techyboy987/firefox-docker:v1

Note: 

  • docker run -it is used to launch the container
  • --net=host is used to set up the host adapter with the container
  • -e DISPLAY is used to display the firefox on the docker
  • We need to transfer the X11 socket from Linux base OS to the container in order to run directly.

These extra arguments are used to set up the base OS environment inside the container


4) Here's the firefox will open



logoblog

Thanks for reading How to Run GUI App on Docker

Previous
« Prev Post

No comments:

Post a Comment

If you have any doubts, Please Comment down