MACHINE LEARNING ON DOCKER CONTAINER

Rohit Jain
3 min readMay 27, 2021

--

TASK1:-

Deploy machine learning on docker

What is machine learning?

Machine learning is learn from past data it is a subset of AI. Machine learning works in a particular way, first, we give the dataset then the model learns features than the output of predicted data.

What is Docker?

Docker is open-source software. Docker is creating and deploying applications using containers. Whenever we need an operating system to test something new, we will not be able to afford many systems. Then we can use the container and launch the OS then test the application.

Follow these steps:-

Step1:- First we install the Docker on rhel8. After following these steps.

Step2:- Open the rhel8 terminal then run the command. We have to pull centos image.
>docker pull centos:latest

Step3:- We have to run docker image on rhel8 terminal.
>docker run -it centos

Step4:- Install python3 in the container.
>yum install python3

Step5:- Install some library on the container. For the moment we will just install two libraries which we need. 1. Pandas 2.sciket-learn
>pip3 install pandas
>pip3 install sciket-learn

Step6:- After installing the library we need a dataset. Now I am copy the data from my rhel8 OS to Docker container centos.
* Run this command on your rhel8 os
>docker cp salary.csv elated_driscoll:salary.csv
*[elated_driscoll] is the name of the container.

Step7:- After copy the dataset we create the python program on container OS in VI text editor.
>vi salary.py

  • In salary.py file write the machine learning code.

Step8:-This is the final step, After Write the code we need to run the program.

>pyhton3 salary.py
Run this command on your container OS.

--

--