GUI Applications running on top of Docker Container.

This article will elaborate on the procedure to run various GUI applications inside the docker container in Linux.

Abhishek Kumar
3 min readJun 1, 2021

Task Overview :

In this blog, we will first run a docker container with GUI mode and after that we will run some GUI applications on top of the docker container that is running on RedHat Linux. Here we will run two applications: firefox web browser and Jupyter notebook.

👉🏻 LAunching a container on docker in GUI mode.

👉🏻 Running GUI applications on top of the docker container.

Step 1 :

First, we have to install docker on Linux and start the docker, for this the commands that will be needed are written in my previous blog for which the link is: 👉🏻click here

Step 2:

Now we will launch a docker container with GUI mode with help of command :

Here we have used X server to run container in GUI mode, X server is usually started from the X Display Manager program xdm(1) or a similar display manager program. This utility is run from the system boot files and takes care of keeping the server running, prompting for usernames and passwords, and starting up the user sessions.

  • - — volume=”$HOME/.Xauthority:/root/.Xauthority:rw” centos:latest : to share the host’s XServer with the container by creating a volume.
  • - -env=”DISPLAY” : to share the host display environment to the container.
  • - -net=host : to run container with host networ

Step 3:

We will install firefox and jupyter notebook in container by giving command :

Step 4 :

We can see jupyter notebook GUI is running successfully.

Step 5:

Lastly, we can see firefox GUI is also running successfully.

This was the whole article. Thanks for reading it. :)

--

--