GUI container on the Docker
Anudeep Nalla
Opensource Contributer | Platform Engineer | EX-NPCI | RHCA Level III | OpenShift | CEPH | CK{S,A,AD} | 3x Microsoft Certified | AWS CSA | Rancher | Nirmata | DevOps | Ansible | Jenkins | DevSecOps | Kyverno | Rook-Ceph
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
· 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> .
· Launch the Docker Container
docker run -it --name <name of os> --env="DISPLAY" --net=host <imagename:tag>
· Launch the GUI Application (Firefox & Jupyter notebook)
· Push the image to docker hub
docker login docker push anuddeeph/dockergui
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
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 !!!
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
.???? Senior DevOps Engineer - I at o9 Solutions | ?? Kubernetes | ?? Docker | ?? Grafana | ?? Azure & AWS Certified | ?? CI/CD Expert | ?? SonarQube | ??? Jenkins | ?? GitLab | ???? Git | ?? Linux |
3 年Nice work ??