{"id":20829412,"url":"https://github.com/davisdre/cloudbuild-build4","last_synced_at":"2026-03-16T11:03:18.890Z","repository":{"id":256471945,"uuid":"855388268","full_name":"davisdre/CloudBuild-Build4","owner":"davisdre","description":"Cloud build demonstration of Docker Swarm.","archived":false,"fork":false,"pushed_at":"2024-09-10T20:28:26.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T18:52:19.211Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/davisdre.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":"2024-09-10T19:32:50.000Z","updated_at":"2024-09-10T20:28:29.000Z","dependencies_parsed_at":"2024-09-10T23:55:31.375Z","dependency_job_id":"11f0abac-7c6b-4a84-84bc-158bbad4c4c3","html_url":"https://github.com/davisdre/CloudBuild-Build4","commit_stats":null,"previous_names":["davisdre/cloudbuild-build4"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davisdre%2FCloudBuild-Build4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davisdre%2FCloudBuild-Build4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davisdre%2FCloudBuild-Build4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davisdre%2FCloudBuild-Build4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davisdre","download_url":"https://codeload.github.com/davisdre/CloudBuild-Build4/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243179815,"owners_count":20249179,"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":[],"created_at":"2024-11-17T23:20:16.782Z","updated_at":"2025-12-25T11:56:29.393Z","avatar_url":"https://github.com/davisdre.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\nIn this cloud build we will be utilizing whatever flavor of cloud in your choosing (ie. Azure/AWS/GCP/Linode). We will be getting familiarize with Docker Swarm and Linux. We will be deploying two compute resources (ie. Azure VM/AWS EC2/GCP VM/Linodes). First we will be deploying our compute resources. Second create our Docker Swarm Manager. Third join our nodes to the manager. Fourth deploy a service to confirm setup. \n\n## Cloud building time\n### Deploy compute resource\nYou can deploy any compute resource of your choosing. We need two VMs so we can create a cluster of Docker hosts. We need to install Docker on each VM. \n\n1. Install Docker using a convenience script from [Docker](https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script). If included this step below, but feel free to give it a read some time.\n```shell\ncurl -fsSL https://get.docker.com -o get-docker.sh\nsudo sh ./get-docker.sh\n```\n\n### Create the Docker Swarm Manager\nThe Docker Swarm Manager’s purpose is to receive commands on behalf of the cluster and assign containers to nodes.\n\n1. Login to your VM you've chosent for Swarm manager and initialize the manager. Replace `PUBLIC_IP` IN THIS example with your VM's public IP address:\n   ```shell\n   docker swarm init --advertise-addr PUBLIC_IP\n   ```\n2. Use `docker info` to verify that your Swarm is running and active.\n   ```shell\n   docker info\n   ```\n\n### Join nodes to the manager\nIn Step 1 of the previous section, the `docker swarm init` command outputs instructions on how to join the manager.\n```shell\ndocker swarm join --token TOKEN PUBLIC_IP:2377\n```\n\n1. To join the node to the Swarm, run `docker swarm join` from the node. Change `TOKEN` to the token from Step 1 in the previous section, and `PUIBLIC_IP` to the manager’s public IP:\n   ```shell\n   docker swarm join --token TOKEN PUBLIC_IP:2377\n   ```\n2. On the manager, use `docker node ls` to view information about the manager and a list of all nodes:\n   ```shell\n   docker node ls\n   ```\n### Deploy a service with Docker Swarm\nTo deploy a service with Docker Swarm, use the manager to prepare a single node, then scale the configuration to match your needs. In this example, you will install a Python app on one node, then scale it to a cluster (swarm) of two nodes.\n\n1. From the Swarm Manager, use service create to deploy a service to a node. Change pythonExample to whatever you like:\n   ```shell\n   docker service create -p 80:80 --name pythonExample davisdre/hostname-webapp\n   ```\n2. Verify that the service has been deployed with `docker ps -a` from any node.\n   ```shell\n   docker ps -a\n   ```\n3. Scale the Python service to two nodes.\n   ```shell\n   docker service scale pythonExample=2\n   ```\n4. Verify that the service has been deployed with `docker ps -a` from any node.\n   ```shell\n   docker ps -a\n   ```\n5. To stop the `pythonExample` service, use the `service remove` command.\n   ```shell\n   docker service remove pythonExample\n   ```\n## Clean up resource\nNow would be a good time to go back and delete your VM's accordingly. \n\n# Resource Links\n- https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script\n- https://hub.docker.com/r/davisdre/hostname-webapp\n- https://docs.docker.com/engine/swarm/swarm-tutorial/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavisdre%2Fcloudbuild-build4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavisdre%2Fcloudbuild-build4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavisdre%2Fcloudbuild-build4/lists"}