Running GUI Applications in Docker Container

Running GUI Applications in Docker Container

Task 02 👨🏻‍💻 


Task Description 📄


📌 GUI container on the Docker


🔅 Launch a container on docker in GUI mode 


🔅 Run any GUI software on the container

STEP - 1

To start the docker service and checks its status, use command.

"systemctl start docker"

No alt text provided for this image

STEP- 2

Pull the Centos Image from dockerhub, use the command.

"docker pull centos:latest

No alt text provided for this image

STEP- 3

To create a customized docker image

Let's say we want to run any application inside the docker container process,This process is called creating a customized docker image or docker build. For this, the best approach to create an image is “Dockerfile”.

Build the Docker image using Dockerfile

"docker built -t <container_image> .

No alt text provided for this image

STEP- 4

Launch the GUI Container:

We will use the docker run command to launch the container.

"docker run --env="DISPLAY" --net=host --name=firefox gui"

We specify the env=”DISPLAY” because we want the container to use the DISPLAY variable from the Host OS.

No alt text provided for this image

Running GUI Applications in Docker Container

No alt text provided for this image


FYI "docker built -t <container_image> . I think that should be "docker builD -t <container_image> .

Like
Reply

To view or add a comment, sign in

More articles by Imran Khan

Explore content categories