Running GUI Application on Docker Container.

Shashwat Gaur
2 min readJun 1, 2021

--

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.

--

--

Shashwat Gaur
Shashwat Gaur

Written by Shashwat Gaur

0 Followers

A tech enthusiast and an aspirer, aiming to olve real life problems, looking forward with a collaborative mindset. Planning to put the skills to best use.

No responses yet