Task 2
Here we will know how to run gui application inside docker (ie- firefox, jupyter)
so first we have to know about
1. Docker — docker is a tool designed to make it easier to create, deploy, and run applications by using containers.
2. Jupyter — 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.
3. So, for any GUI application to run, we need to have XServer which is already available in all Linux systems.
Xserver — The X server is a single binary executable(/usr/x11R6/bin/Xorg)[in rhel8] that dynamically loads any necessary X server modules at runtime from the /usr/X11R6/lib/modules/ directory. Some of these modules are automatically loaded by the server, while other are optional. The X server and its configuration files are stored in /etc/X11/ directory. The configuration file of X server is /etc/X11/xorg.conf.
But, when we launch a container, we don’t have Xserver configured here, so what we can do is
the following cmd will configured Xserver
docker run -it — — name GUI — — net=host — — env=”DISPLAY” — — volume=”$HOME/.Xauthority:/root/.Xauthority:rw” centos:latest
after we have to install some software 1. python3
yum install python3
2. firefox
yum install firefox
3. jupyter
pip3 install jupyter
we have intall all those software
so now the time to launch jupyter notebook
jupyter notebook — allow-root
as we can see jupyter is runing in the docker container.