{"id":19904366,"url":"https://github.com/ambidextrous9/docker-for-ml-model-training","last_synced_at":"2026-04-12T02:35:24.228Z","repository":{"id":206724689,"uuid":"717513652","full_name":"ambideXtrous9/Docker-for-ML-Model-Training","owner":"ambideXtrous9","description":"How to use docker to train ML Model","archived":false,"fork":false,"pushed_at":"2026-02-05T10:53:57.000Z","size":200,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-05T22:17:59.825Z","etag":null,"topics":["docker","dockerfile","ml","pytorch","pytorch-lightning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ambideXtrous9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-11T17:35:50.000Z","updated_at":"2026-02-05T10:54:02.000Z","dependencies_parsed_at":"2023-11-11T21:38:57.339Z","dependency_job_id":null,"html_url":"https://github.com/ambideXtrous9/Docker-for-ML-Model-Training","commit_stats":null,"previous_names":["ambidextrous9/docker-for-ml-model-training"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ambideXtrous9/Docker-for-ML-Model-Training","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambideXtrous9%2FDocker-for-ML-Model-Training","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambideXtrous9%2FDocker-for-ML-Model-Training/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambideXtrous9%2FDocker-for-ML-Model-Training/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambideXtrous9%2FDocker-for-ML-Model-Training/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ambideXtrous9","download_url":"https://codeload.github.com/ambideXtrous9/Docker-for-ML-Model-Training/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambideXtrous9%2FDocker-for-ML-Model-Training/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31702580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","dockerfile","ml","pytorch","pytorch-lightning"],"created_at":"2024-11-12T20:28:06.674Z","updated_at":"2026-04-12T02:35:24.222Z","avatar_url":"https://github.com/ambideXtrous9.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker for ML Model Training\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://skillicons.dev\"\u003e\n    \u003cimg src=\"https://skillicons.dev/icons?i=docker,py,git,pytorch,\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nA comprehensive cheat sheet for managing Docker containers, images, and compose environments for Machine Learning workflows.\n\n## 1. Image Operations\n\n**Build Docker Image**\n```bash\n# Basic build\nsudo docker build -t docker_ml .\n\n# Build without cache (force rebuild)\nsudo docker build -f Dockerfile -t docker_ml . --no-cache \n```\n\n**List Images**\n```bash\nsudo docker images\n```\n\n**Remove Images**\n```bash\n# Remove specific image(s)\nsudo docker rmi \u003cImage_Name_or_ID\u003e\n\n# Remove all unused images\nsudo docker image prune -a\n```\n\n## 2. Container Operations\n\n**Run Containers**\n```bash\n# Run and open interactive terminal (bash)\nsudo docker run -it docker_ml /bin/bash\n\n# Run specific command inside container\nsudo docker run -it docker_ml /bin/bash -c \"cd src \u0026\u0026 python temp.py\"\n\n# Run in background (detached mode)\nsudo docker run -d -p 8080:8080 --name my_ml_container docker_ml\n```\n\n**Manage Containers**\n```bash\n# List running containers\nsudo docker ps\n\n# List all containers (including stopped ones)\nsudo docker ps -a\n\n# Stop a specific container\nsudo docker stop \u003cContainer_ID_or_Name\u003e\n\n# Stop ALL running containers\nsudo docker stop $(sudo docker ps -a -q)\n\n# Remove a specific container\nsudo docker rm \u003cContainer_ID_or_Name\u003e\n```\n\n**Interactive Access**\n```bash\n# Access shell of a running container\nsudo docker exec -it \u003cContainer_ID_or_Name\u003e /bin/bash\n```\n\n## 3. Docker Compose Workflow\n\n**Start Services**\n```bash\n# Start and build images\ndocker compose up --build\n\n# Start in detached mode (background)\ndocker compose up -d\n```\n\n**Stop Services**\n```bash\n# Stop and remove containers, networks\ndocker compose down\n\n# Stop specific environment file\ndocker compose -f docker-compose-development.yml down\n```\n\n**View Compose Logs**\n```bash\ndocker compose logs -f\n```\n\n## 4. specific project commands\n\n```bash\n# 1. Stop the running containers\ndocker compose -f docker-compose-development.yml down\n\n# 2. (Optional) Remove the old containers completely to ensure a clean start\ndocker compose -f docker-compose-development.yml rm -f\n\n# 3. Start the containers with the updated configuration\ndocker compose -f docker-compose-development.yml up -d\n\n# 4. Verify the containers are running\ndocker compose -f docker-compose-development.yml ps\n\n# 5. (Optional) Check the logs to ensure everything started correctly\ndocker compose -f docker-compose-development.yml logs -f\n```\n\n**Check Logs for Backend**\n```bash\nsudo docker logs -f recall-riskscore-backend\n```\n\n## 5. Debugging \u0026 Maintenance\n\n**Logs \u0026 monitoring**\n```bash\n# Follow log output of a specific container\nsudo docker logs -f \u003cContainer_ID_or_Name\u003e\n\n# View resource usage stats (CPU/Memory) - Critical for ML\nsudo docker stats\n```\n\n**Inspection**\n```bash\n# Inspect container details (JSON format)\nsudo docker inspect \u003cContainer_ID_or_Name\u003e\n```\n\n**System Cleanup**\n```bash\n# Remove unused images, containers, and networks to free up space\ndocker system prune -f\n\n# Deep clean (including unused images)\ndocker system prune -a\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fambidextrous9%2Fdocker-for-ml-model-training","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fambidextrous9%2Fdocker-for-ml-model-training","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fambidextrous9%2Fdocker-for-ml-model-training/lists"}