{"id":18755021,"url":"https://github.com/savanarohit/docker","last_synced_at":"2026-04-11T11:32:09.853Z","repository":{"id":168635731,"uuid":"644401835","full_name":"savanarohit/Docker","owner":"savanarohit","description":"This GitHub repository is your go-to resource for learning Docker. It includes hands-on tutorials, sample projects, best practices, and a curated list of learning materials to help you master Docker from basics to advanced concepts.","archived":false,"fork":false,"pushed_at":"2024-07-01T10:24:37.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T01:33:18.111Z","etag":null,"topics":["docker","docker-compose","dockerfile","dockerhub","httpd","nodejs","php7"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/savanarohit.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}},"created_at":"2023-05-23T12:49:04.000Z","updated_at":"2024-07-04T15:31:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"918a9a43-9d77-4ac0-81e3-6f0272efb905","html_url":"https://github.com/savanarohit/Docker","commit_stats":null,"previous_names":["savanarohit/docker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savanarohit%2FDocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savanarohit%2FDocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savanarohit%2FDocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savanarohit%2FDocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/savanarohit","download_url":"https://codeload.github.com/savanarohit/Docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239644127,"owners_count":19673580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","docker-compose","dockerfile","dockerhub","httpd","nodejs","php7"],"created_at":"2024-11-07T17:31:15.967Z","updated_at":"2025-10-27T12:12:11.745Z","avatar_url":"https://github.com/savanarohit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### Docker \u0026 Docker Compose installation on Ubuntu OS\n\n1) Update Ubuntu OS\n\n  sudo apt update\n\n2) Install Docker dependencies\n\n  sudo apt install apt-transport-https ca-certificates curl software-properties-common -y \u0026\u0026 sudo apt update\n\n3) Install Docker Community Edition and Docker Compose\n\n  sudo apt install Docker-ce -y \u0026\u0026 sudo apt install Docker-Compose -y\n\n4) Create a Docker Group\n\n  sudo groupadd Docker\n\n5) Add the current user to the Docker Group\n\n  sudo usermod -aG Docker $USER \u0026\u0026 newgrp Docker\n\n6) Reboot the system\n\n  sudo reboot\n\n### Docker Commands\n\n#### Create an image using this directory's Dockerfile\n\n  Docker build -t friendlyname.              \n\n#### Run \"friendlyname\" mapping port 4000 to 80\n\n  Docker run -p 4000:80 friendlyname          \n\n#### Same thing, but in detached mode\n\n  Docker run -d -p 4000:80 friendlyname       \n\n#### Enter a running container\n\n  Docker exec -it [container-id] bash         \n\n#### See a list of all running containers\n\n  Docker ps                                   \n\n#### Gracefully stop the specified container\n\n  Docker stop \u003chash\u003e                          \n\n#### See a list of all containers, even the ones not running\n\n  Docker ps -a                                \n\n#### Force shutdown of the specified container\n\n  Docker kill \u003chash\u003e                          \n\n#### Remove the specified container from this Machine\n\n  Docker rm \u003chash\u003e                            \n\n#### Remove the force-specified container from this Machine\n\n  Docker rm -f \u003chash\u003e                         \n\n#### Remove all containers from this Machine\n\n  Docker rm $(Docker ps -a -q)                \n\n#### Show all images on this Machine\n\n  Docker images -a            \n\n#### Remove the specified image from this Machine\n\n  Docker rmi \u003cimagename\u003e\n\n#### Remove all images from this Machine\n\nDocker rmi $(Docker images -q)              \n\n#### Live tail a container's logs\n\n  Docker logs \u003ccontainer-id\u003e -f               \n\n#### Login to this CLI session using your Docker credentials\n\n  Docker login                                \n\n#### Tag \u003cimage\u003e for upload to registry\n\n  Docker tag \u003cimage\u003e username/repository:tag  \n\n#### Upload tagged image to a registry\n\n  Docker push username/repository:tag         \n\n#### Run image from a registry\n\n  Docker run username/repository:tag          \n\n#### Remove all unused containers, networks, images (dangling and unreferenced), and volumes optionally. (Docker 17.06.1-ce and superior)\n\n  Docker system prune                         \n\n#### Remove all unused containers, networks, and images not just dangling ones (Docker 17.06.1-ce and superior)\n\n  Docker system prune -a                      \n\n#### Remove all unused local volumes\n\n  Docker volume prune \n\n#### Remove all unused networks\n\n  Docker network prune                        \n\n\n### Docker Compose\n\n#### Create and start containers\n\n  Docker-Compose up                           \n\n#### Create and start containers in detached mode\n\n  Docker-Compose up -d                        \n\n#### Stop and remove containers, networks, images, and volumes\n\n  Docker-Compose down                         \n\n#### View output from containers\n\n  Docker-Compose logs                         \n\n#### Restart all service\n\n  Docker-Compose restart                      \n\n#### Pull all image service \n\n  Docker-Compose pull                         \n\n#### Build all image service\n\n  Docker-Compose build                        \n\n#### Validate and view the Compose file\n\n  Docker-Compose config                       \n\n#### Scale special service(s)\n\n  Docker-Compose scale \u003cservice_name\u003e=\u003creplica\u003e\n\n#### Display the running processes\n\n  Docker-Compose top                          \n\n#### Start web service, run bash as its command, and remove the old container.\n\n  Docker-Compose run -rm -p 2022:22 web bash  \n\n### Docker Services\n\n#### Create a new service\n\n  Docker service create \u003coptions\u003e \u003cimage\u003e \u003ccommand\u003e\n\n#### Display detailed information Service(s)\n\n  Docker service inspect --pretty \u003cservice_name\u003e   \n\n#### List Services\n\n  Docker service ls                                \n\n#### List the tasks of Services\n\n  Docker service ps                                \n\n#### Scale special service(s)\n\n  Docker service scale \u003cservice_name\u003e=\u003creplica\u003e    \n\n#### Update Service options\n\n  Docker service update \u003coptions\u003e \u003cservice_name\u003e  \n\n### Docker Stack \n\n#### List all running applications on this Docker host\n\n  Docker Stack ls                               \n\n#### Run the specified Compose file\n\n  Docker Stack deploy -c \u003cComposefile\u003e \u003cappname\u003e\n\n#### List the services associated with an app\n\n  Docker Stack services \u003cappname\u003e               \n\n#### List the running containers associated with an app\n\n  Docker Stack ps \u003cappname\u003e                     \n\n#### Tear down an application\n\n  Docker Stack rm \u003cappname\u003e                     \n\n### Docker Machine\n\n#### Create a VM (Mac, Win7, Linux)\n\n  Docker-Machine create --driver virtualbox myvm1                          \n\n#### Win10\n\n  Docker-Machine create -d hyperv --hyperv-virtual-switch \"myswitch\" myvm1 \n\n#### View basic information about your node\n\n  Docker-Machine env myvm1                                                 \n\n#### List the nodes in your swarm\n\n  Docker-Machine ssh myvm1 \"Docker node ls\"                                \n\n#### Inspect a node\n\n  Docker-Machine ssh myvm1 \"Docker node inspect \u003cnode ID\u003e\"                 \n\n#### View join token\n\n  Docker-Machine ssh myvm1 \"Docker swarm join-token -q worker\"             \n\n#### Open an SSH session with the VM; type \"exit\" to end\n\n  Docker-Machine ssh myvm1                                                 \n\n#### Make the worker leave the swarm\n\n  Docker-Machine ssh myvm2 \"Docker swarm leave\"                            \n\n#### Make master leave, kill the swarm\n\n  Docker-Machine ssh myvm1 \"Docker swarm leave -f\"                         \n\n#### Start a VM that is currently not running\n\n  Docker-Machine start myvm1                                               \n\n#### Stop all running VMs\n\n  Docker-Machine stop $(Docker-Machine ls -q)                              \n\n#### Delete all VMs and their disk images\n\n  Docker-Machine rm $(Docker-Machine ls -q)                                \n\n#### Copy file to node's home dir\n\n  Docker-Machine scp Docker-Compose.yml myvm1:~                            \n\n#### Deploy an app\n\n  Docker-Machine ssh myvm1 \"Docker Stack deploy -c \u003cfile\u003e \u003capp\u003e\"           \n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavanarohit%2Fdocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsavanarohit%2Fdocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavanarohit%2Fdocker/lists"}