GUI Application on Docker

Running a GUI program in Docker can be a useful technique when you’re evaluating a new piece of software. You can install the software in a clean container, instead of having to pollute your host with new packages.
Here we will know how to run gui application like Firefox , Jupyter Notebook in our Docker container.
Steps:
- Install docker
Firstly, Install the Docker and start and check it. For this part refer to the following blog.
- Now let’s install a GUI application like firefox inside the container.
yum install firefox -y

- After the installation let’s start firefox.

It gives some error saying that no display environment variable specified. So we require some display environment to run GUI applications.
- Now launch one more container with env $DISPLAY, and install firefox.
docker run -it — net=host — env=”DISPLAY” centos

Here I am using — net = host, because I want to use network of host system. So everything for connecting and networking we will use our host system for it.
- Again run firefox.

Now it Works Perfectly.
- Now Let’s install jupyter notebook.
- For intalling Jupyter Notebook, first we have to install python3.
yum install python3 -y

- Then install Jupyter
pip3 install jupyter

- After installation is complete launch jupyter notebook
jupyter notebook — allow-root


Jupyter Notebook is Successfully launched on Docker Container!!