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

Getting Solid with SOLID — Part 1 — Single Responsibility Principle

Exception Handling

Agave Development Update #14 / 04–10 July, 2021

“What, Why, How” Docker Compose?

CS — Super Talent Can Be Made

graphql-ruby : How to pass down multiple args to the child field (type)

DAO Index: Recruiting Raters

Functional Swift: Category Theory — Introduction

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 share docker images without Docker hub or any registry

Setup https for nginx on AWS EC2 Linux Instance using docker + certbot(Lets Encrypt)

How to run GUI software inside a Docker container

Full Installation Guide of MySQL 8.0 on Ubuntu Machine