DOCKER

SET UP GUI CONTAINER

shristi sharma
3 min readMay 29, 2021

Docker is an open-source project that automates the deployment of applications inside software containers. These application containers are similar to lightweight virtual machines, as they can be run in isolation from each other and the running host.

Docker is an open-source containerization engine, which automates the packaging, shipping, and deployment of any software applications that are presented as lightweight, portable, and self-sufficient containers, that will run virtually anywhere. A Docker container is a software bucket comprising everything necessary to run the software independently. There can be multiple Docker containers in a single machine and containers are completely isolated from one another as well as from the host machines

Dockerfiles:

Dockerfiles are files used to programmatically build Docker images. They allow you to quickly and reproducibly create a Docker image, and so are useful for collaborating. Dockerfiles contain instructions for building a Docker image by using the docker build commands

Dockerfiles are of the form:

# This is a comment INSTRUCTION arguments

  • Instructions are upper case only
  • The first instruction of a Dockerfile must be FROM to specify the base image

Now you have learned some basics terminologies let’s start with the demonstration

Launch Graphical User Interface Inside Docker Container

Step 1: Create a directory

Create one directory where code will be saved here dockergui is a directory inside that we create a Dockerfile

Step 2: Write a code to create a Dockerfile

Step 3: Build the image

  • -t 👉 terminal
  • firefox_gui 👉Give any name

Step 5: Check the Build image

Step 5: Run the Command

docker run -it - -env= “DISPLAY” - -net=host - -name<give any name of your choice> <image name>

--net = for using host’s network

--env = for using environmet varibale (DISPLAY)

Step 6: Firefox will launch Successfully

Let’s check whether another application is launched or not

Step 7: Open Jupyter Notebook Inside Docker Container

jupyter notebook --allow-root

Similarly, try to open another GUI application ✍

So in this article, you learn to set up Gui inside Docker Container.💥

If you want to give any suggestions you can connect with me on my LinkedIn 👇

www.linkedin.com/in/shristi-sharma-46540b1aa

Thank You🙂

Keep Sharing Keep Learning✨

--

--

shristi sharma

Aspiring Devops Enthusiastic |Content Creator |Python | Machine Learning | Cloud Computing