RUN GUI Applications In Docker Container

 

RUN GUI Applications In Docker Container 


What is Docker?

  • Docker is a containerization platform tool for building an application in which container contains packaged binary files and its library files with its required dependencies, and further these containers are easily shipped to run on other machines.          
  • Each and every application runs on separate containers and has its own set of dependencies & libraries.

What is a Docker container?

  • Docker containers are basically runtime instances of Docker images.
  •  Docker is a tool designed to make it easier to create, deploy and run applications by using containers. 


Now, let’s see how to launch GUI application in Docker -

1.  Make & Go to Directory

            mkdir dockergui
            cd dockergui




2 . Create A Dockerfile & Write Commands .

        To create Dockerfile

        vim dockerfile


 What is Dockerfile?

A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.
Commands:
FROM 
Use  FROM to set the base image for subsequent instructions. In every valid Dockerfile, FROM is the first instruction.
RUN
The RUN command to execute any instructions in a new layer on top of the current image. With each RUN command, we add something on top of the image and use it in subsequent 
CMD
The CMD command to provide default values of an executing container. In a Dockerfile, if we include multiple CMD commands, then only the last instruction is used. 


3. Build the Docker image using Dockerfile.

    docker build -t firefoxgui .

4.Launch the GUI Container.

        docker run -it --name guifirefox --env="DISPLAY" --net=host firefoxgui:latest



    --env="DISPLAY"
    It is used to display the firefox on the docker

    --net=host
     It is used to set up the host adapter with the container

Launch Successful :)



Thank You




Comments

Popular posts from this blog

Revolutionizing Industries: Solving Challenges with Ansible

How to Install & run docker inside docker?

Creating a Python Script to Capture and Process Face Photos