GUI Container on Docker Container
1 min readJun 11, 2021
In this blog, we will launch GUI application (Firefox) inside a docker container.
Pre-requisites :-
- Docker installed (Redhat8 as the base OS)
Steps:-
- First, after installing docker and starting its services. you need to pull one docker image.
- Pull one image using $docker pull “OS_Name”
$docker pull centos
- Then After our image is pulled successfully, we need to run our image. To run docker image.
$docker run -it centos
- Now let’s install GUI application firefox inside the container.
$yum install firefox -y
- After the installation let’s start firefox.
$firefox
- It shows error because there no display environment variable specified. So we required some display environment to run GUI applications in our docker container.
- So we need to define DISPLAY while launching container.
- Now launch one more docker container with env $DISPLAY.
- Open BaseOS terminal now, and run command:
$docker run -it — net=host — env=”DISPLAY” centos
- Now again install firefox and run it.
- After opening firefox Now, We can see a firefox web browser is open.
