How to Run GUI Application On Docker Container
Hey Everyone!

Welcome you all to my article based on Task-02 of GUI inside Docker(Linux World MLOps summer Training 2021)
So in this blog we will see that how to run a GUI Application inside a Docker Container. In this we will run a Jupyter Notebook using Firefox.
Firstly let’s see that What is Docker?
In simple terms, Docker is a software platform that simplifies the process of building, running, managing and distributing applications. It does this by virtualizing the operating system of the computer on which it is installed and running.
Now, why we use Jupyter Notebook?
Jupyter is a free, open-source, interactive web tool known as a computational notebook, which researchers can use to combine software code, computational output, explanatory text and multimedia resources in a single document.
In this we are using RHEL8 as a Base OS and CentOS in running in the Docker Container.
Step 1: Run this command to run the docker container with configuration of Xserver
# docker run -it — — name GUI — — net=host — — env=”DISPLAY” — — volume=”$HOME/.Xauthority:/root/.Xauthority:rw” centos:latest
After this Docker will start.
Step 2: Now install python3 inside the container using,
yum install python3

Step 3: Install Firefox inside the container using,
# yum install firefox


Step 4: Now we’ll install jupyter-notebook using,
# pip3 install jupyter

Step 5: Run the jupyter-notebook using,
# jupyter notebook --allow-root


as we can see jupyter is running in the docker container.
Task Done Successfully!
That’s it for this blog, Hope you liked it!!!!
If you want to connect, Below is my LinkedIn profile-