RUNNING GUI APPS IN A DOCKER CONTAINER
What is GUI?
Graphical user interface (GUI), a computer program that enables a person to communicate with a computer through the use of symbols, visual metaphors, and pointing devices. A GUI displays objects that convey information, and represent actions that can be taken by the user.
Difference between GUI and CLI:
CLI consumes low memory.While GUI consumes more memory. In CLI we can obtain high precision.While in GUI, low precision is obtained. CLI is faster than GUI. CLI operating system needs only keyboard.While GUI operating system need both mouse and keyboard.
So, now let's have a description about our task:
?? GUI container on the Docker:
?? Launch a container on docker in GUI mode
?? Run any GUI software on the container
Let's start with the installation of docker using command: yum install docker.
Now, when you are done with the installation of docker, you can have the description of docker using command: docker info
Let's start the docker services using command: systemctl start docker
Now, we can see that our docker services are successfully running. Now pull the OS image, i.e., docker pull centos:latest
Make the directory for writing Dockerfile and change the directory and write the Dockerfile.
- PackageKit-gtk3-module — Install fonts automatically using PackageKit
- Libcanberra is an implementation of the XDG Sound Theme and Name Specifications, for generating event sounds on free desktops, such as GNOME. It comes with several backends (ALSA, PulseAudio, OSS, GStreamer, null) and is designed to be portable.
Now, let's build the DockerImage from DockerFile by using command:
docker build -t <container_image> .
- -t - Tag option helps us to tag the image with a proper name.
- Dot operator at the last means that the Dockerfile is present in the current folder.
Now, let's launch GUI container from the Image:
- Share the DISPLAY environment variable to the Container OS, i.e., --env="DISPLAY"
- Run the OS with the Host’s Network driver, i.e., --net=host
OUTPUT:
For launching Jupyter Notebook From the Image:
Use command: jupyter notebook --allow-root
Its Output:
Thank you for reading this article!!!!!!
?