GUI CONTAINER ON DOCKER

Summer Program 2021 #Task2

🧾Task Description:

- Launch a GUI supported container on docker

- Run any GUI software on the container

Step1: Check the Docker

We use the command:

docker info

if Docker is unavailable, We use the command:

yum install docker-ce

Step-2: Pull container image and run the container

To pull the container, We use the command:

docker pull centos

Run the container, We use the command:

docker contaiiner run -it — net=host — name=<container_name> -env= DISPLAY<docker_image>:<version>

Explanation of code

docker container run -i -t — name=<name> centos:latest is The conventional code of creating a container with interactive(-i) terminal(-t).

net=host- to configure the container's network so that it shares the network interface with the host.
1. This allows us to use the internet inside our docker without further configuration.
2. It allows the x-11 connection to run on the host.

env= DISPLAY- We specify that the environmental variable ‘DISPLAY’ will be the same inside container as well as the host machine.

Step-3: Installing python3 and other softwares

i) Install Python

We use the command:

yum install python3

ii) Install Firefox

We use the command:

yum install firefox

iii)Install Jupyter Notebook

Python3 has a dependency called pip3

We use the command:

pip3 install jupyter

Step 4: Launch the GUI

Launch the Jupyter Notebook, We use the command:

jupyter notebook — allow-root

A Firefox Window opens with Jupyter running in it

Thank you!

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Implement a Hash Map in JavaScript

Why does your child need Computational Thinking?

Golang: Setup + First Go App

Frame vs Bounds in iOS

2D Galaxy Shooter — Shooting an Asteroid to Start the Spawn Manager!

Interact with Kubernetes resources in PHP 8

Install/Use rbenv (Ruby) on Windows 10 Linux WSL(2)

5 Observations; 1 Complex Question

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mohammed Adnan

Mohammed Adnan

More from Medium

How to perform subdomain based routing using AWS with an application load balancer and Elastic…

Detect unused secrets in your Github repositories

Automate IoT Deployments with Soracom Event Handler | Soracom

How To Setup Nginx Reverse Proxy Server On Ubuntu 20.04