Task 02- Run GUI Application inside Docker Container
In this blog , I am going to launch two GUI application inside Docker Container ( i.e Firefox and gedit)

Step 1: Pull the Docker Container image from DockerHub.

Here, I have pulled the CentOs image using cmd “docker pull centos".

Use the “docker images" cmd to check the images.

Step 2: Launch Container
Now, we will use the CentOs image to create a new container.

Use Command: ‘docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix — name <container_name> centos’
Here, we have added an environmental variable $DISPLAY for the X11 display and mounted a volume /tmp/.X11-unix/:/tmp/.X11-unix for the X11 Unix socket as the X server is responsible for GUI.

Step 3: Launch the GUI Application in the container.

  • Launch gedit
    First,check whether the application or software is present or not. If it not present inside container, we will install it using yum command.
  • Now run gedit.
  • Successfully launched the gedit software.
  • Launch Firefox
    First, check whether the application or software is present or not
  • Install Firefox using the yum command.
  • Now, run Firefox.
  • Successfully launched both the GUI Application inside the docker container.

--

--

--

Learner at Linux World | Teerthanker Mahaveer University

Love podcasts or audiobooks? Learn on the go with our new app.

READ/DOWNLOAD*> Mastering Linux Kernel Development

Switch to Node Version Manager (nvm) on macOS using Homebrew

Modern OAuth for Single Page Applications Using PKCE

Should you script at work?

What is System Integration?

Creating a Data Analysis Pipeline in Python

Terraform: Deploying A Docker Image to An AWS ECS Cluster.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Riya Jain

Riya Jain

Learner at Linux World | Teerthanker Mahaveer University

More from Medium

BGP- Prevent Transit AS using Prefix List

Database Agnostic Pagination of Time-Series Results

In this code I implement template using Template function from string module.

Character Encoding basics: A.S.C.I.I.