Deploying Machine Learning Model on Docker Container .

Jainsiddhant
2 min readMay 28, 2021

--

Docker is everywhere in the software industry today. Mostly popular as a DevOps tool, Docker has stolen the hearts of many developers, system administrators and engineers, among others.It can be integrated with ML to run different models.

The process of using docker container for running ML models is very easy. We just need to follow following steps:

Step 1:

Train your model using jupyter notebook and name the trained model as “salary_predictor.pk1”.

Training the ML model on Jupyter Notebook

Step 2:

Transfer the trained model om the RHEL8 system using WinSCP software.

Transferring the model to RHEL8 workspace.

Step 3:

Install the Docker and pull an CentOS image from docker hub and launch the container.

Pulling the latest image of CentOS
Running an OS name salary_pred using Docker.

Step 4:

Copying the model inside the docker Container and go inside the docker to check whether the file is copied properly or not.

Copying the file into Docker container and verifying the process.

Step 5:

Install python, joblib and scikit-learn inside the docker container.

installing python inside the docker container.
installing joblib inside the docker container.
installing scikit-learn inside the docker container.

Step 6:

Finally load the model using joblib.load and you can successfully run your ML model inside the docker container.

Loading the model inside the docker container.

Open for any queries and suggestions.

Thank you

--

--