Machine Learning Using Docker Container

Hello Friends!!🖐

Divyansh garg
3 min readMay 27, 2021

Hope you all are safe and good.

In this article, I am going to show you how to make an Salary Predictor app Using Machine learning and Docker.

Task Overview

Pull the Docker container image of CentOS image from Docker Hub and create a new container.

Install the Python software on the top of docker container.

In Container you need to copy/create machine learning model which you have created in jupyter notebook.

WHAT IS MACHINE LEARNING ?

Machine learning is the concept that a computer program can learn and adapt to new data without human intervention. Machine learning is a field of artificial intelligence (AI) that keeps a computer’s built-in algorithms current regardless of changes in the worldwide economy.

WHAT IS DOCKER ?

Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime.

Now we will create a Salary Predictor App using Docker. I have used RedHat Linux as the base operating system and installed docker over it.

😁 Steps to Follow:

STEP 1:-

INSTALLING DOCKER ON RHEL8 Using “yum install docker-ce”

Checking status of docker whether it is running or not

“systemctl status docker” command shows the status of docker

Pull the Docker container image of CentOS image from DockerHub and create a new container

“docker pull centos:latest” is used for pulling image

“docker run -it __name CONTAINERNAME centos:latest” for launching container.

STEP 2:-

Install the Python software on the top of docker container

python can be installed using “yum install python3” command

STEP 3 :-

Copying the Machine Learning Model from local host to docker container.

“docker cp <src> <container_name>:<dest>” is used for copying from local host to container.

STEP 4:-

Install required libraries required to load ML model :-

All required libraries can be installed from the following command:

pip3 install <name of library>

STEP 5:- Install git to clone your repository

STEP 6:- Clone your repository and move inside the directory.

STEP 7:- Finally running the python code file.

That’s all for this blog. Hope you liked it.😁

Below given are my Github repository and my LinkedIn Profile Links.

YOU CAN ALSO FOLLOW ME THERE!!!😀✌

--

--