DEV Community

Cover image for Dockerize a Python ML Model and push in GitHub(With Steps + ScreenShots)
Gokila Narasimman
Gokila Narasimman

Posted on

Dockerize a Python ML Model and push in GitHub(With Steps + ScreenShots)

1.Checkout to main
Command:
git checkout main

Image description

2.Create a new branch (e.g., feature branch)
Command:
git checkout main -b features-24mcr027

Image description

3.(Optional) Add a branch through GitHub UI

Go to GitHub → Your Repo → Branch Dropdown → Type branch name → Create branch

Image description

4.Check current branches

Command:
git branch

Image description

5.Check status of changes

Command:
git status

Image description

6.Add all changes

Command:
git add .

Image description

7.Commit your changes
Command:
git commit -m "Added hello.py"

Image description

8.Push your branch to GitHub

Command:
git push origin features-24mcr027

Image description

9.Create a Pull Request on GitHub

Go to GitHub → Pull Requests → New Pull Request → Select branch → Create Pull Request → Merge Pull Request → Confirm Merge

Image description

Image description

Image description

DOCKER COMMANDS

1.Check Docker version

Command:
docker --version

Image description

2.Create a Dockerfile in your project

Image description

3.Build Docker image

Command:
docker build -t gokila07/mca-24mcr042-ml:latest .

Image description

4.List Docker images

Command:
docker images

Image description

5.Push Docker image to DockerHub

Command:
docker push gokila07/mca-24mcr027

Image description

6.Open Docker Desktop to view images and containers

Image description

7.Run the Docker container

8.Verify the Docker image and running container in Docker Desktop (GUI)

Image description

PUSH DOCKER FILE INTO GITHUB

Image description

Main branch
First Branch: feature-24mcr027

Image description

Second Branch: dockerfile

Image description

Image of Stellar post

How a Hackathon Win Led to My Startup Getting Funded

In this episode, you'll see:

  • The hackathon wins that sparked the journey.
  • The moment José and Joseph decided to go all-in.
  • Building a working prototype on Stellar.
  • Using the PassKeys feature of Soroban.
  • Getting funded via the Stellar Community Fund.

Watch the video 🎥

Top comments (0)