DEV Community

Cover image for πŸš€ I Dockerized a simple ML model and uploaded it to GitHub with step-by-step commands and screenshots. Perfect for beginners! πŸ”₯
Kanaga Durga M
Kanaga Durga M

Posted on

πŸš€ I Dockerized a simple ML model and uploaded it to GitHub with step-by-step commands and screenshots. Perfect for beginners! πŸ”₯

πŸ“ Git Workflow

  1. Checkout to main branch. Command: git checkout main Image description ➑️ Switch to the main branch to start fresh.
  2. Create a new feature branch. Command: git checkout -b feature-24mcr042 Image description ➑️ Create and move to a new branch for your work.
  3. (Optional) Create a branch through GitHub UI. Go to GitHub β†’ Open your repo β†’ Click on Branch Dropdown β†’ Type new branch name β†’ Create branch. Image description ➑️ Useful if you prefer using GitHub's website.
  4. Check all available branches. Command: git branch Image description ➑️ List all branches in your local repo and see which branch you are on.
  5. Check the status of your changes. Commands: git status Image description ➑️ View what files are staged, unstaged, or untracked.
  6. Add all changes to staging area. Command: git add . Image description ➑️ Stage all modified or new files for committing.
  7. Commit your changes with a message. Command: git commit -m "Added hello_world.py" Image description ➑️ Save your staged changes into the local repo with a meaningful message.
  8. Push your branch to GitHub. Command: git push origin feature-24mcr042 Image description ➑️ Upload your feature branch to the remote GitHub repository. 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 Image description Image description Image description 🐳 Docker Workflow
  9. Check Docker version. Commands: docker --version Image description ➑️ Confirm Docker is installed and check the version.
  10. Build the Docker image. Commands docker build -t kanaga14/mca-24mcr049-ml:latest . Image description ➑️ Build a Docker image from your Dockerfile.
  11. List all Docker images. docker images Image description ➑️ See all Docker images available locally.
  12. Push Docker image to DockerHub. docker push kanaga14/mca-24mcr042-ml Image description ➑️ Upload your Docker image to your DockerHub account. 5.Open Docker Desktop (Optional). Image description ➑️ View your images and running containers through Docker’s graphical interface. 6.Run the Docker container. Image description 7.Verify running container in Docker Desktop. Image description ➑️ Use the GUI to check your running containers and images visually.

Top comments (0)