GUI container on the Docker

GUI container on the Docker

Task 2

Task Description

a) GUI container on the Docker

b) Launch a container on docker in GUI mode

c) Run any GUI software on the container.

Pre-requisites:

  • Host OS should be GUI
  • Docker installed in your OS

Because the Host OS will share the DISPLAY with the Docker container, and the container will presume it has a display, the Host OS should be GUI.

 Launch a container on docker in GUI mode

a)   First create a workspace

b)  Create custom Docker Image

There are two methods of doing this

a) Docker Commit

b) Dockerfile

Here iam using Dockerfile

No alt text provided for this image
No alt text provided for this image

 

·       If you want to learn about Dockerfile, refer to Dockerfile documentation.

·       Dockerfile has its own specific keywords like FROM, RUN and soon

·       To launch the Docker container with GUI, Install PackageKit-gtk3-module and libcanberra-gtk2 module

·       libcanberra-gtk2: Libcanberra is an implementation of the XDG Sound Theme and Name Specifications, for generating event sounds on free desktops, such as GNOME. It comes with several backends (ALSA, PulseAudio, OSS, GStreamer, null) and is designed to be portable.

·        packagekit-gtk3-module: PackageKit is a system designed to make installing and updating software on your computer easier. The primary design goal is to unify all the software graphical tools used in different distributions and use some of the latest technology like PolicyKit.

·       Build the image

docker build -t <imagename>:<tag>  .
No alt text provided for this image

·       Launch the Docker Container

docker run -it --name <name of os> --env="DISPLAY" --net=host <imagename:tag>
No alt text provided for this image

·       Launch the GUI Application (Firefox & Jupyter notebook)

No alt text provided for this image
No alt text provided for this image

·       Push the image to docker hub

docker login

docker push anuddeeph/dockergui
No alt text provided for this image

GitHub

Note:

Another Way:

If your Host OS is CLI, which is installed on the top of VirtualBox, You can refer the Below Article

Thankyou 

Ajeenkya S.

Jr. Soft Engg @Cognizant, EDI-Maps Developer, 2X OCI, 1xAWS Certified, 1X Aviatrix Certified, AT&T Summer Learning Academy Extern, LW summer Research Intern, ARTH Learner, 1X Gitlab Certified Associate, ARTH 2.0 LW_TV

3 年

Great work Anudeep !!!

回复
Babuni Rout

Senior Consultant DevOps | RHCA | OpenShift AI ML |?OpenShift | Kubernetes | OpenShift ACM ACS | OpenShift CNV | OpenShift ODF | OpenShift Installation & Operation | CICD | Podman | Ansible | Linux | ArgoCD | Helm

3 年

Best of luck

回复
Saumik Satapathy

.???? Senior DevOps Engineer - I at o9 Solutions | ?? Kubernetes | ?? Docker | ?? Grafana | ?? Azure & AWS Certified | ?? CI/CD Expert | ?? SonarQube | ??? Jenkins | ?? GitLab | ???? Git | ?? Linux |

3 年

Nice work ??

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了