Running any GUI software on Container

Divyansh garg
3 min readMay 31, 2021

Hello friends!!🖐

I’m back with some new Content for you. In this article, I’m going to show you how to run any GUI software on a docker container.

Task Overview

👉 Launch a container on docker in GUI mode.

👉 Run any GUI software on the container.

What is A Container ?

A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.

A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

WHAT IS X11 ?

X11 is a family of protocols that allows applications to create objects such as windows and use basic drawing primitives (e.g. fill a rectangle, display some text). Widgets like buttons, menus, etc. are made by client libraries.

Now, I will practically show you how to run a GUI software on a docker Container.

✍STEPS TO FOLLOW:

STEP 1:- Checking the status of docker whether it is running or not .

“Systemctl status docker” command shows the status of docker.

STEP 2:- Creating a new Container with X11 enabled in background.

Use “docker container run -it -e DISPLAY=$DISPLAY -v /tmp/.x11-unix:/tmp/.X11-unix — name jupyter-firefox centos;8” command to create a container with X11 working.

After creating a new container, install firefox on that Container.

STEP 3:- After successfully installing Firefox, Now Install Jupyter on the same container.

Use “pip3 install jupyter” command to install jupyter on the docker container.

STEP 4:- NOW that we have successfully installed Jupyter also, Start jupyter notebook on the Container.

Finally, a GUI Software i.e. jupyter is running on a docker container.

That’s all for this article.

Hope You liked it.😀

--

--