🎓ML Prediction Model Inside Docker Container

Lovely Shrivas
2 min readMay 31, 2021

--

Task:

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

📚Install the Python software on the top of Docker Container.

📚Inside the container copy/create Machine Learning model which have created in Jupyter Notebook.

Github Link:

04lovely12/prediction_model (github.com)

Linkedin Link:

https://www.linkedin.com/posts/lovely-shrivas-a84353193_task1-docker-ml-activity-6803700954777706496-6_sJ

Steps:

📕Step 01:Install Docker

cd /etc/yum.repos.d/

vim docker.repo

(press i to insert, then write all the content given inside the { })

{

[docker]

baseurl = https://download.docker.com/linux/centos/7/x86_64/stable/

gpgcheck = 0

name = Docker repo

}

(press esc type :wq , to save)

yum repolist

yum install docker-ce --nobest -y

systemctl start docker

systemctl status docker

systemctl restart docker

📗Step 02:Launch Container

docker pull centos:latest

docker run -it centos:latest

📘Step 03:Install Python & Libraries inside Container

yum install python3

pip3 install sklearn

pip3 install pandas

pip3 install joblib

pip3 install numpy

📒Step 04:Copy Model file

Inside base OS run this command to copy file from rhel to container.

docker cp filename containername:/

Write a code inside the file and save it (inside the container)

vi filename.py

{

load your code

}

📙Step 05:Run code file and Check prediction of Model(inside Container)

python3 filename

Now give input and check the working of application.

exit

systemctl stop docker (inside base OS)

--

--

Lovely Shrivas
Lovely Shrivas

Written by Lovely Shrivas

Hi.....I have keen intrest in technologies and love to learn and explore them. Hope my content is helpful to all of you.if any issue please let me know.

No responses yet