Integrate Machine Learning Model with Docker Container
Task 01 👨🏻💻
Task Description 📄
👉 Pull the Docker container image of CentOS image from DockerHub and create a new container.
👉 Install the Python software on the top of docker container.
👉 In Container Copy the Python file from the docker host.
👉 Install the Required python libraries to required to load ML Model.
👉 Run the python code for the prediction.
What is Docker ?
Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files.
👉 Pull the Docker container image of CentOS image from DockerHub and create a new container.
Step 1.
“docker pull” is a one command in the docker to download the docker image from the internet or docker registry.
“docker pull centos:latest”
docker run is a command in docker to launch the container
“docker run -it — name newos centos:latest”
👉 Install the Python software on the top of docker container.
Step 2
👉 Install the Python and Git software on the top of docker container.
- To install python-3.8 and latest git, use command:
"yum install python38 git"
👉 Cloning the Git Repository
Step 3
Cloning the Git Repository
- Go to the GitHub repository where your machine learning model, as well as the required files, are present.
- Use command "git clone <Repo_URL>" to clone the Github repository.
👉 Install the Required python libraries to required to load ML Model.
Step 4
Install the Python libraries
- Python Libraries are a set of useful functions that eliminate the need for writing codes from scratch. Python libraries play a vital role in developing machine learning, data science, data visualization, image and data manipulation applications, and more.
👉 Run the python code for the prediction.
Step 5
Execute the program
- We are going to execute the program using a Python3 Interpreter.
Check the output/result
- After execution, it looks like this.
- Finally to stop the container use the following command: "docker stop newos"
Written By: @IMRAN KHAN
Thank You