GUI container on the Docker

Prasad Pokale
3 min readJun 1, 2021

--

If we try to run any GUI software on the Docker container then it will error. So, we will see how we can fix that..

Follow the steps that are given here

Step 1: Install Docker on your system then start and enable the docker

yum install docker

systemctl start docker

systemctl enable docker

Step 2: pull theimage of centos os with version 8

Launch the container and give any name here I have given prasados and syntax is

docker container run -it — name=<file_name> centos:8

Step 3: Now install firefox -y

After the completion try to run firefox but it will give u error.

Go to your localhost and execute the following commands:

create one directory and inside that directory create a Docker file

Here I have made directory called sky and inside that I have created Dockerfile

Step 4: paste the given commands in that Docker file.

Step 5: Now build it

docker build -t firefox

now in order to access firefox use

docker container run -it — env=”DISPLAY” — net=host firefox

and after running this command you will get the following output

Excellent…!!!!

we did, our firefox is running on our docker container

Thanks for reading…

--

--