Trained ML model over Docker

Bhavna Surendra Latare
3 min readMay 31, 2021

Hello Readers!

In this article we are going to discuss about deploying a trained Machine Learning model over Docker — a containerization technology.

Note : The practical is performed on AWS cloud and RHEL is used as base os.

Let’s start…………

Step 1 : Install Docker

Configure yum

Command to check yum is configured or not : yum repolist

check yum is configured or not

Install docker

Command : yum install docker-ce — nobest

Start and enable docker services

To start the service : systemctl start docker

To enable the service : systemctl enable docker

To check the status of the service: systemctl status docker

Step 2 : Pull Docker image

Here, we are pulling centos image and launching the container with name “ML-summer-os”

Command :

docker pull centos:latest

docker run -it — name ML-summer-os centos:latest

Step 3 : Install software required for data analysis

Commands:

yum install python3

pip3 install sklearn pandas

install python3
install sklearn pandas using pip3

Step 4 : Install git

Command: yum install git

install git to clone

Step 5 : Clone the git repository

Command: git clone <repository_link>

Step 6 : Go to the folder and list the files

We are able to see our files created in it. To efficiently run python files convert the .ipynb files to .py files

Step 7 : Run the file Salary_Prediction.py

ML code for training the model
OUTPUT

Thus, we have deployed our model on Docker container.

Do try this practical!!!

Keep Learning!

Keep Sharing!

Stay safe……….

--

--

Bhavna Surendra Latare

I am a student passionate about Programming and Development | DSA Enthusiastic | working on ML | exploring Indian Culture