Running GUI-image on DOCKER(2)

Task Description 📄

📌 GUI container on the Docker

🔅 Launch a container on docker in GUI mode

🔅 Run any GUI software on the container

X Window System

The X Window System X11 is a windowing system for bitmap displays, common on Unix-like operating systems.

X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting with a mouse and keyboard. X does not mandate the user interface — this is handled by individual programs. As such, the visual styling of X-based environments varies greatly; different programs may present radically different interfaces.

XServer — X is an architecture-independent system for remote graphical user interfaces and input device capabilities. Each person using a networked terminal has the ability to interact with the display with any type of user input device.

Xserver X11

X11 is the latest version of softwear of the XServer

Developed by MIT by foundation

X11 is a softwear which is already present in linux based OS eg. RHEL distribution etc .

XServer is the heart of LINUX GUI it helps to manage your mouse and keyboard

XServer — we call it as server bcoz it has capability to display o/p not only on the local monitor connected but a monitor connected via network

we can control where the XServer softwear in OS should display its i/p by using the $DISPLAY env variable .

The DISPLAY env variable contains the IP address of the system where the XServer is going to send its display output .

Now lets run an gui application on docker

Here i will be running [“jupyter notebook”] on docker container on linux system .

First check the DISPLAY env variable on host OS its >> [:0]

Using docker run cmd and checking out help option ,

we have -e for giving env variable for image here i’m using [centos] .

and -v for mounting volume we need to use these two options to make our container use display of the base of .

Now using these 2 options launch the container

What happens is that by default there is not value assigned for the DISPLAY variable in container

So we are assigning our base OS’s values to the [Container/Image]

Here is the proof that the containers dont have any thing stored for the DISPLAY variable … echo $DISPLAY prints nothing .

Now installing required softwears inside the container .

Installing [python , (jupyter library)] and [firefox] , on the container .

Now using jupyter notebook command launching the application .


  • Here container is providing data to the volume we mounted to the BASE_OS and ,
  • DISPLAY env variable has assigned the host’s display to container and with the help of XServer softwear which has capability to work remotely ,the data is displayed from container to the display of host.





Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Ruby on Rails Basics with VS Code— Top 5 extensions

The Horror of Blocking Electron’s Main Process

Finding Your Coding Niche- Claire Parker

How to Fix FATAL: password authentication failed for user “postgres” in ubuntu 20.4

Moonbeam Network入选Web 3.0训练营

Hello everyone, this is my first time every trying to blog so please bear with me on this venture.

Unity Physics

Collatz — The Simplest Program That You Don’t Fully Understand

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



More from Medium

Stop Moving Your @$#{@% City Hall!

Moonbet Monday Recap — February 28

Some Good TIPS For ALL New World Players


Virgo includes some bright stars and many bright galaxies. The brightest star in the Virgo constellation is called Spica.