Launching GUI Apps on the Docker Container.

Devanshu Singh
2 min readMay 30, 2021

--

Hello everyone, In this blog, I am going to tell you guys how to launch a GUI application on the Docker Containers.

The Only prerequisite is we should have a Linux OS with Docker installed on it.

To know how to install Docker on the RHEL8 Linux. Click here

So here are some steps:

STEP 1:

Start the docker services and pull CentOS Docker Image from the docker hub.

STEP 2:

Launch the Docker container, but if we launch it with the command docker run -it — name=GUIcont centos:latest , we cannot run the GUI apps. So we have to change the command.

Here comes the interesting thing, the — env flag defines a variable in our container that matches our DISPLAY variable on the host.

STEP 3:

Now we have to Run some GUI application on the container to see if it runs or fails.

For this, we are running the jupyter notebook & the jupyter notebook uses the web browser to run on it. And the web browser is a GUI app.

After running all the above commands the firefox browser will open with the jupyter notebook.

I hope you guys understand how to launch the GUI app on the container.

Thank you guys for reading,

GitHub Link:-

https://github.com/devanshu06/Docker-GUI

--

--