GUI Application on Docker — ARTH Task 26 | LW Summer Task 2

Task Objectives

Sangeeth Sahana D
2 min readMay 25, 2021

🔅 Launch a container on docker in GUI mode

🔅 Run any GUI software on the container

Running GUI Applications in Docker — Firefox, Nautilus File Manger. |  LaptrinhX

Running a GUI application in Docker container cannot be done by using normal docker run commands, we need to connect to the display element with the container in order to do so.

In this article, we will see how to run the firefox application in our docker container.

STEP 1: INSTALL DOCKER

For the installation part of docker refer to the following blog

STEP 2: Start and check the service of docker

systemctl start docker
systemctl status docker

STEP 3: Create a Docker file

vim Dockerfile

Write the following contents to your Docker file

# Set centos as base image
FROM centos
# Install dependencies
RUN yum install firefox -y
# Run firefox
CMD [“/usr/bin/firefox”]

STEP 4: Build the Docker Image

docker build -t <image name> .

You can check your built image using,

docker images

STEP 5: Launch GUI application On the Docker container

docker run -it --env=”DISPLAY” --net=host --name <name for your application> <your created image name>

Finally, the application will be launched!!!

Thank You!

--

--