Hello learners,
Today i got a new task how to run GUI applications in container.
we known that by default we can't run GUI applications in docker container because of non-availability of xserver which is required to meet this challenge.
let me show you how to overcome with this challenge:-
Follows these instructions carefully
Install docker in your os
-yum install docker-ce
start docker services
-systemctl start docker
Now pull any image you want in my case i pulled centos latest one
-docker pull centos:latest
It is already in my system you can download it from above command.
launch the docker container with following options.
-docker run -it --net=host --env="DISPLAY" centos:latest
here i pass --net=host means i want to use host connectivity and provide an --env to share docker's host display.
After successffully launch of docker container install firefox
-yum install firefox -y
Now run firefox command
-firefox
so you see it runs successfullyđź‘Ť
Now we can run jupyter notebook
install python
-yum install python3
install jupyter notebook
-pip3 install jupyter
After successfully installed launch jupyter notebook
-jupyter notebook
it shows some error so we have to bypass it with root permission
jupyter notebook --allow-root
Finally it is launched successfullyđź‘Ť
Thanks for reading.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)