Deploying Machine Learning Model inside a Docker.

Deploying Machine Learning Model inside a Docker.

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.

Machine learning (ML) is a branch of artificial intelligence (AI) that focuses on building applications that can automatically and periodically learn and improve from experience without being explicitly programmed.

Task Description

1. Pull the Docker image of CentOS image from DockerHub and create a new container

2. Install the Python software on the top of docker container

3. Inside the Container you need to copy/create machine learning model and train it.


Step 1:- Check if docker is installed or not.

rpm -q docker-ce


No alt text provided for this image

Step 2:- Start Docker services.

systemctl start docker 

No alt text provided for this image

Step 3:- Pull the Centos Image from Docker hub.

docker pull centos:latest

No alt text provided for this image

Step 4:- Create a Container with the help of Centos image.

docker run -it --name MyOS centos:latest

No alt text provided for this image

Step 5:- New docker container has started.

No alt text provided for this image

Step 6:- Download Python3 softwere inside Container.

yum install python3


No alt text provided for this image

Step 7:-  Install all the libararies your Machine Learning model depends on.

pip3 install numpy
 
pip3 install sklearn

pip3 install pandas


No alt text provided for this image

Step 08 : Copy Your Dataset inside Docker.

docker cp dataset_filename(in your local system) docker_os_name:path 

No alt text provided for this image
No alt text provided for this image

Dataset copied sucessfully.

Step 9:- Train your Model

No alt text provided for this image

Model trained sucessfully

Step 10:- Run your model

No alt text provided for this image

Our Model is sucessfuly running inside a docker container.

Thanks for reading ??

AAFAQ RASHID

DevOps Engineer at Comprinno Technologies | AWS Certified Security - Specialty

3 年

Great job done

Bhat Sumair

DevOps Engineer | AWS Certified Cloud Practitioner

3 年

????????????????

要查看或添加评论,请登录

社区洞察

其他会员也浏览了