GUI Container on Docker Container

Akshay Gupta
1 min readJun 11, 2021

--

In this blog, we will launch GUI application (Firefox) inside a docker container.

Pre-requisites :-

  • Docker installed (Redhat8 as the base OS)

Steps:-

  • First, after installing docker and starting its services. you need to pull one docker image.
  • Pull one image using $docker pull “OS_Name”

$docker pull centos

  • Then After our image is pulled successfully, we need to run our image. To run docker image.

$docker run -it centos

  • Now let’s install GUI application firefox inside the container.

$yum install firefox -y

  • After the installation let’s start firefox.

$firefox

  • It shows error because there no display environment variable specified. So we required some display environment to run GUI applications in our docker container.
  • So we need to define DISPLAY while launching container.
  • Now launch one more docker container with env $DISPLAY.
  • Open BaseOS terminal now, and run command:

$docker run -it — net=host — env=”DISPLAY” centos

  • Now again install firefox and run it.
  • After opening firefox Now, We can see a firefox web browser is open.

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

--

--

Akshay Gupta
Akshay Gupta

No responses yet

Write a response