{"id":15129851,"url":"https://github.com/acavalin/dswarm","last_synced_at":"2026-01-19T07:11:29.438Z","repository":{"id":256281381,"uuid":"854798735","full_name":"acavalin/dswarm","owner":"acavalin","description":"Easily manage docker stacks, services, images, contexts and repositories","archived":false,"fork":false,"pushed_at":"2024-09-16T21:25:19.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T04:30:19.738Z","etag":null,"topics":["cli","docker","docker-compose","docker-images","docker-machine","docker-registry","docker-swarm","ruby","terminal","terminal-based"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/acavalin.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-09T19:48:22.000Z","updated_at":"2024-09-16T21:25:22.000Z","dependencies_parsed_at":"2024-10-31T11:15:17.395Z","dependency_job_id":null,"html_url":"https://github.com/acavalin/dswarm","commit_stats":null,"previous_names":["acavalin/dswarm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acavalin%2Fdswarm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acavalin%2Fdswarm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acavalin%2Fdswarm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acavalin%2Fdswarm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acavalin","download_url":"https://codeload.github.com/acavalin/dswarm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386854,"owners_count":20930729,"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":["cli","docker","docker-compose","docker-images","docker-machine","docker-registry","docker-swarm","ruby","terminal","terminal-based"],"created_at":"2024-09-26T02:21:50.549Z","updated_at":"2026-01-19T07:11:29.429Z","avatar_url":"https://github.com/acavalin.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dswarm\nA script to easily manage docker stacks, services, images, contexts and repositories.\n\n## 1. Configuration\nThis terminal script can operate on your swarms by reading environment variables\nfor context, stack name, and registry url (thus shortening commands).\n\nYou can set each variable in your shell or create a `.dockerswarm` file\nin your project's root folder to autoload them at runtime:\n\n~~~yaml\nDOCKER_CONTEXT:  context_name\nDOCKER_STACK:    stack_name\nDOCKER_REGISTRY: registry.gitlab.com/username/project_name\n~~~\n\n## 2. Usage\n\n~~~\nUSAGE: dswarm \u003caction\u003e [params]\n~~~\n\n### 2.1 Actions for managing stacks \u0026 services\n~~~\n  \u003cd|deploy\u003e       [stack-name] [compose.yml] [-f|--foreground]\n  ls               [-s|--simple]\n  ps               [stack-name] [-u|--usage] [-f|--full]\n  rm               [stack-name] [-f|--force]\n  \u003cs|services\u003e     [-f|--full]\n  \u003ci|inspect\u003e      \u003cservice-id\u003e [-p|--pretty]\n  \u003cl|logs\u003e         \u003cservice-id\u003e [-f|--follow]\n  \u003cr|restart\u003e      \u003cservice-id\u003e\n  \u003cu|update\u003e       \u003cservice-id\u003e [image-tag]\n  \u003ct|top\u003e          \u003cservice-id\u003e\n  \u003ce|exec\u003e         \u003cservice-id\u003e [command [args]] [-- docker-args]\n~~~\n\nNote: The `deploy` action can run the eventual script `dswarm-deploy.hook`\npassing the argument `pre`/`post` respectively before and after the deploy process.\n\n### 2.2 Actions for managing images\n~~~\n  \u003clsi|images\u003e     # list images\n  \u003cb|build\u003e        \u003cimage-name\u003e[:tag] [build-folder]\n  \u003cP|push\u003e         \u003cimage-name\u003e[:tag]\n  \u003cp|pull\u003e         [\u003cimage-name\u003e[:tag]]\n  \u003cclean|clear\u003e    [-c|--cache]\n  run              \u003cimage-id\u003e   [command [args]] [-- docker-args]\n~~~\n\nNote: The `build` action can run the eventual script `dswarm-build.hook`\npassing the argument `pre`/`post` respectively before and after the build process.\nThe file must be inside the build folder.\n\n### 2.3 Actions for managing contexts\n~~~\n  \u003cc|context\u003e      ls\n  \u003cc|context\u003e      add \u003ccontext-name\u003e \u003cssh-user@address\u003e\n  \u003cc|context\u003e      rm  \u003ccontext-name\u003e\n  \u003cc|context\u003e      env \u003ccontext_name\u003e [sh|fish|cmd|powershell]\n  \u003cc|context\u003e      unset              [sh|fish|cmd|powershell]\n  ssh              [remote-command]\n~~~\n\nNote: Contexts will be created using by default the SSH adapter but you can always\nuse `docker context create` to create your own, however keep in mind that the `ssh`\naction will not work when using a different adapter.\n\n## 3. Examples\n\n~~~shell\n# create a new context\ndswarm context add myvps root@myvps-address.com\n\n# configure file for dswarm\necho \"DOCKER_CONTEXT: myvps\" \u003e .dockerswarm\necho \"DOCKER_STACK: awesomeapp\" \u003e\u003e .dockerswarm\necho \"DOCKER_REGISTRY: registry.gitlab.com/jonsmith/awesmeapp.com\" \u003e\u003e .dockerswarm\n\n# enters `docker/images/myapp` folder, runs `docker build`\n# and tags the image with DOCKER_REGISTRY prefix\ndswarm build myapp:v1 docker/images/myapp\n\n# test the image by running it in a ephemeral container\n# applying some docker options too (volume and port mappings)\ndswarm run myapp bash -ilc screen -- -v /path/to/data:/data -p 3000:3000\n\n# push image to registry\ndswarm push myapp\n\n# run some maintenance commands on remote machine\ndswarm ssh mkdir -p /app-data\ndswarm ssh chown smith:users /app-data\n\n# deploys the `awesomeapp` stack using `awesomeapp.yml` compose file\ndswarm deploy\n\n# show process statuses and CPU/MEM usage\ndswarm ps --usage\n\n# open a bash shell in the first container running the `myapp` image\n# applying some docker options too (change process user)\ndswarm exec myapp -- -u smith\n\n# remove the `awesomeapp` stack\ndswarm rm\n~~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facavalin%2Fdswarm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facavalin%2Fdswarm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facavalin%2Fdswarm/lists"}