Containerization of Machine Learning Model.

Abhinandan Nahar
2 min readMay 27, 2021

--

What is “Docker”?

  • Docker is an open platforom for developing,shipping,and running applications.Docker enables you to seperate your applications from your infrastruture so you can deliver software quckly.With docker you can manage your infrastructure in the same ways you manage your applications.By taking advantage of Docker’s methodohies for shipping,testing,and deploying code quickly.

Step 1:

Pull the Docker container image of CentOS image from DockerHub.

  • I have pulled the Centos image.
  • Command:docker pull centos
  • Launched the os by giving the name “st2021”.
  • Command: docker run -it — name=st2021 centos

Step 2:

  • Install the Python on the top of docker container.
  • To installed the python software in the CentOS ,I have used following command.
  • Command: yum install python3

Step 3:

  • After installing the python on CentOs ,I have installed all the lmodule that is required.
  • Command: pip3 install module name
  • Ex. pip3 install numpy.

Step 4:

  • After that I have copied the data set file “Salary_Data.csv” that i have already in the redhat .For that firstly I go in my root directory and go into the folder where I saved that file(“Salary_Data.csv”)
  • Command:docker Summer_Program2021/
  • Command:ls
  • Command:docker cp Salary_Data.csv st2021:/

Step 5:

  • In container I create machine learning model which I have created in jupyter notebook.
  • By running these files with python3 I get my expected output.

Thanks For Reading!!!

--

--

No responses yet