Running GUI Program Inside DOCKER

Vineet Negi
Apr 15, 2021

--

Have u ever tried to launch GUI programs like firefox , gedit etc … Well u might not be able to launch them but with few lines of code u can launch graphical programs inside docker.

  • So I have created a small Dockerfile contains base image as centos and inside that we’ll be launching firefox and when I try to launch container using this image firefox automatically launched.
Dockerfile
  • Now to run this Dockerfile
docker build -t docker_gui .
--------
docker_gui is the name of the image
. -> is the location of the Dockerfile
  • Now Let’s launch the container
docker run -it --env="DISPLAY" --net=host docker_gui

TASK COMPLETED …..

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Vineet Negi
Vineet Negi

Written by Vineet Negi

★ Aspiring DevOps Engineer ★ Technical Volunteer @LinuxWorld ★ Technical Content Writer @Medium ★ ARTH Learner

No responses yet

Write a response