Docker_GUI

Nishant Saini
2 min readMay 23, 2021

--

Task Description

GUI container on the Docker

Launch a container on docker in GUI mode

Run any GUI software on the container

To run any GUI program, we need X-Server, without the help of X-Server, we can’t run any GUI program.

So, we will launch a docker container with access to the docker host’s X-Socket.

Also, we must provide the container with a “DISPLAY” environment variable. This instructs our graphical programs – which X server to connect to.

For this, we should also know the name of our terminal, as all the programs are run by the terminal.

Now, we can run GUI program, inside the docker container.

Also by-default only authorized clients can connect to X11 Sever of Redhat and docker container cann’t use it.

So, run command “xhost +” in docker host, so that docker container can use X11 server of base O.S.

We will run gedit(text editor) inside this Container.

So, we will first install the gedit text editor.

Now, we can use gedit command to use gedit text editor (GUI program).

Now, we can add data to the file, and then save the file. The file will appear inside the container.

Hence, task Completed.

#vimaldaga#righteducation#educationredefine#rightmentor#worldrecordholder #linuxworld #makingindiafutureready #righeducation #arthbylw #docker #container

--

--

Nishant Saini
Nishant Saini

Written by Nishant Saini

0 Followers

RedHat Certified Engineer (RHCE) | AWS Academy Graduate | DevOps Enthusiast

No responses yet