Machine Learning Model inside Docker Container
Task Description:
- Pull an image and launch an container.
- Install python inside docker container.
- copy/create a machine learning model.
Step 1: We will start by creating a model
Step2: Now , we will check if docker is installed or not.
If not installed , we can use this command to install docker
yum install docker-ce
Step3: Launching container
To download an image use command
docker pull centos:latest
To launch a container use following command
docker run -it --name ML centos:latest
you can also check if container is launched using command
docker ps
Step:4 Installing python inside docker container
To install python inside our container the command used is
yum install python3
We will also install some libraries that will be required for our Machine learning code to run
pip3 install numpy pandas scikit-learn
Step:5 Copying Machine Learning code inside container
using this command we can copy files from base OS to container.
Here, salary.pk1 and SalaryData.csv are the files which we want to copy and ML is the name of container and /codes is the location where we want our files to get stored.
Step:6 Creating a python file to run our model
we will create a python file
vi model.py
Now, finally we will run our model and see if it works
THANK YOU!!!!