Sitemap
Press enter or click to view image in full size

GUI on Docker πŸ‹

2 min readJun 1, 2021

--

Task Description πŸ“„

πŸ“Œ GUI container on the Docker

πŸ”… Launch a container on docker in GUI mode

πŸ”… Run any GUI software on the container

What is Docker ?

Docker is a set of platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels. Because all of the containers share the services of a single operating system kernel, they use fewer resources than virtual machines.

Press enter or click to view image in full size

It’s good practice to create Custom Image using Dockerfile, I used the code as

FROM centos:latest

RUN yum install python36 firefox -y

RUN pip3 install jupyter

Run command to build Image

#docker build -t <tag>:<version> <location of Dockerfile>

Launch a container

We can use the command for running container

#docker run -it β€” name <container name> β€” net=host β€” env=”DISPLAY” β€” hostname=containerhost <image>:<version>

After running this command we’ll go inside container and also we can verify by hostname of container. now we can directly run gui apps in the container i run firefox for testing.

Press enter or click to view image in full size
Press enter or click to view image in full size

we can see some warnings here but our app will launch finally.

Press enter or click to view image in full size

Thanks for Reading !!

Keep Learning !! Keep Sharing !!

--

--

Yash Dwivedi
Yash Dwivedi

Written by Yash Dwivedi

Technical Person, Open for Every Technology.

No responses yet