Launching Web-server and Python 3 repl using Docker Container
In this article what we going to see…
Basically it is an task to lunch a web server and python repl over docker container . Let’s see what we do..
What is Docker..??
How to install Docker on Linux OS..?
Lunching web server over Docker Container..
Implementing python-repl in Docker OS..
Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package.
Now Let’s How to install docker on Linux OS
For installing docker first we have create an repository for docker in base OS of Linux. For that we have first go to /etc/yum.repos.d/ after that we have to create one file using extension .repo . In that put docker url for downloading. And for checking our repository is created or not then run command..
And for checking the docker package is available or not the use command..
yum list docker-ce
Here our repository is ready and our docker package also present.And here we use -ce for community edition of docker.
After that we are going to install a docker container for that use command..
yum install docker-ce — nobest
Here we see our docker installation complete..!
Now let’s see our docker is install in our OS or not..for that we use two different command having same use..
yum list docker-ce
rpm -q docker-ce
Here we can see our docker is installed.
After that let’s start the docker and check the status of our docker.
systemctl start docker
systemctl status docker
Now, our docker is in running state i.e. Active.
For seeing our docker information use command
Now our installation process completed..
So,Let’s move towards lunching web server on docker OS..
**Lunching Web-Server over Docker..
For lunching new OS on docker we have images of that particular OS for uploading that images on docker and seeing image use command..
docker pull (image name):(version)
Here we pull ubuntu : 14.04 image for lunching web-server.
So for lunching web server on docker we have to start new OS of ubuntu : 14.04 For that use command.
docker run -it — name (OS_name) ubuntu : 14.04
Here our new OS of ubuntu lunch.
So now for lunching web server on this new ubuntu OS we use command on this..
apt-get install apache2
Here we lunch apache web server.
Here our server apache2 get started.
So our service get started . After that we have to configure our website in /var/www/html/ folder and create web page .
Here we create dockerweb.html web page for our task.Do ifconfig and take IP of ubuntu OS.
We can now access the website from the IP of our Docker Container.
Here our web server is working good… And our task for web server is completed .
Now let’s move towards our next task that is configuring python repl in our docker container.
**Configuring Python Repl in our Docker Container..
Here for configuring python repl we install new image of CentOS:8 . command for that..
docker pull centos:8
Our new image for CentOS : 8 is lunched.
Now , Launching a new centos container for python repl :
docker run -it — name (OS_name) centos : 8
Here our new OS of centOS is been lunched.
Now let install Python3 on this CentOS OS and command for that is
yum install python3
Here our python3 repl is ready to use.Start this and Let’s do some programming of python in it.
Our python3 repl is working good. Let’s create some file using python and run this in our CentOS OS .
…..Yes,we did our second task successfully.
****If you like it then Clap and Share….!!!!
- **If you like it then follow me in LinkedIn ………
Pritee Dharme - Dr. Ashok Gujar Technical Institute's Dr.Daulatrao Aher College of Engineering…
View Pritee Dharme's profile on LinkedIn, the world's largest professional community. Pritee's education is listed on…
..**Thank You for visiting ..Hope this blog help you…!!