Running GUI Application on Docker Container.
Let’s recall the previous concepts from the previous blog, whereby we installed docker on the redhat OS and launched our centos container using the docker command and ran our machine learning model over it.
The task in this blog is to run a GUI application on docker container, where we have till date worked only in command line. The stepwise guide is as under:
Firstly, either use an existing docker container or pull a new image. Secondly install firefox application using the <yum install firefox > command. Now try to run firefox by typing <firefox> in cli.
We encounter an error explaining the absence of display . We need an environment variable for display, let be $DISPLAY. Launch docker now , run the command <docker run -it — net= host — env=”DISPLAY centos> and install firefox here as well. The net , means we are using host network.After completion open. We have achieved the GUI.
As simple as that, we have launched a GUI app on docker.