Running Machine Learning model in Docker Container
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.
Following is our Task 1:
?? 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.
?? In Container you need to copy/create machine learning model which you have created in jupyter notebook.
Now, let's start with the first step, i.e. pulling the docker image from Dockerhub and thus creating a new container.
NOTE:- Check whether you have the repo of docker by using command "yum repolist" and install the docker by using command "yum install docker-ce".
After successful installation of the docker, pull the Docker Container Image of CentOS from Dockerhub by using command:- docker pull centos:latest
After successful pulling of the docker image, run the container by using command:- docker run -it --name task1 centos:latest
Now, the container has been launched successfully. Let's install the python3 libraries by using command:-
yum install python3
Install pandas by using command, pip3 install sklearn pandas
Now, for creating or copying the machine learning model, we'll first create the github repo and upload all the necessary files there.
Then clone it into the container by using command of git clone.
Note:- CHECK WHETHER YOU HAVE GIT COMMAND INSTALLED IN YOUR RHEL-8 OS.
Now, the last step... LET'S RUN PYTHON FILE FOR PREDICTION.
Hurrahhh!!!!!!! TASK HAS BEEN COMPLETED SUCCESSFULLYYYY!!!!!!
My Github Repo URL:- https://github.com/Vrush-cmd/LWMLOPS2021.git
Thank you for reading till here!!!!!????