DEV Community

Cover image for πŸ“š Day-3 Assignment: Create a Docker Image for Your Machine Learning Project πŸš€
Surya N
Surya N

Posted on

πŸ“š Day-3 Assignment: Create a Docker Image for Your Machine Learning Project πŸš€

Step 1: πŸ“‚ Set Up Folder Structure & Download Dataset

  • Create a proper folder structure for your project.

  • Download the Iris Dataset from Kaggle and place it inside your project directory.

Image description

Step 2: 🐳 Write the Dockerfile

  • Create a Dockerfile to define the environment for your ML project.

  • Start by specifying the base image:

FROM python:3.9
Enter fullscreen mode Exit fullscreen mode
  • This pulls the official Python 3.9 image along with the necessary dependencies.

  • Install the essential Python libraries required for the project:

RUN pip install pandas matplotlib scikit-learn
Enter fullscreen mode Exit fullscreen mode
  • Copy all files from your local directory to the working directory inside the container:
COPY . .
Enter fullscreen mode Exit fullscreen mode
  • Set the command to run your application when the container starts:
CMD ["python", "hello.py"]
Enter fullscreen mode Exit fullscreen mode

Image description

Step 3: πŸ—οΈ Build the Docker Image

  • Build the Docker image using the following command:
docker build -t surya2k42/24mcr114:latest .
Enter fullscreen mode Exit fullscreen mode

Image description

Image description

Image description

Image description

Top comments (0)