🎓ML Prediction Model Inside Docker Container
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:
Linkedin Link:
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)