{"id":13585022,"url":"https://github.com/neuroforgede/docker-swarm-proxy","last_synced_at":"2025-04-07T06:32:17.703Z","repository":{"id":175681208,"uuid":"654312873","full_name":"neuroforgede/docker-swarm-proxy","owner":"neuroforgede","description":"What if you wanted a docker exec, but for Docker swarm? - Control any node in the swarm from your CLI","archived":false,"fork":false,"pushed_at":"2023-07-12T17:55:00.000Z","size":36,"stargazers_count":34,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T21:12:35.705Z","etag":null,"topics":["cli","devops","devops-tools","docker","docker-cli-plugin","docker-swarm","docker-swarm-mode","plugin","swarm"],"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/neuroforgede.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}},"created_at":"2023-06-15T21:17:46.000Z","updated_at":"2025-01-19T04:43:56.000Z","dependencies_parsed_at":"2024-01-14T17:18:26.997Z","dependency_job_id":"70c0213b-5526-4426-9838-7c8d96dd6162","html_url":"https://github.com/neuroforgede/docker-swarm-proxy","commit_stats":null,"previous_names":["neuroforgede/docker-swarm-proxy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuroforgede%2Fdocker-swarm-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuroforgede%2Fdocker-swarm-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuroforgede%2Fdocker-swarm-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuroforgede%2Fdocker-swarm-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuroforgede","download_url":"https://codeload.github.com/neuroforgede/docker-swarm-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247607292,"owners_count":20965942,"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","devops","devops-tools","docker","docker-cli-plugin","docker-swarm","docker-swarm-mode","plugin","swarm"],"created_at":"2024-08-01T15:04:41.450Z","updated_at":"2025-04-07T06:32:17.673Z","avatar_url":"https://github.com/neuroforgede.png","language":"Python","funding_links":[],"categories":["Python","Community Tools"],"sub_categories":["Extra Functionality"],"readme":"# docker-swarm-proxy\n\nWhat if you wanted a docker exec, but for Docker swarm?\n\nA problem with Docker Swarm and automation with it has been that you can't directly exec into any service from the command line. There exist some workarounds to achieve this behaviour, but in the end you want something similar and as convenient as `docker exec` but for services.\n\n![grafik](https://github.com/neuroforgede/docker-swarm-proxy/assets/719760/e40aae96-1b0f-4193-8f7e-1054b5db6a6e)\n\n## Installation\n\n### Prerequisites\n\nInstall docker-py and click:\n\n```bash\npip3 install docker\npip3 install click\n```\n\nInstall the plugin your docker cli (from github)\n\n```bash\nrm ~/.docker/cli-plugins/docker-swarmproxy\ncurl -L https://raw.githubusercontent.com/neuroforgede/docker-swarm-proxy/master/docker_swarm_proxy.py -o ~/.docker/cli-plugins/docker-swarmproxy\nchmod +x ~/.docker/cli-plugins/docker-swarmproxy\n```\n\nOr copy from a local copy of this repo:\n\n```bash\ncp docker_swarm_proxy.py ~/.docker/cli-plugins/docker-swarmproxy\nchmod +x ~/.docker/cli-plugins/docker-swarmproxy\n```\n\n## Usage\n\nNOTE: For remote clusters, only usage of the DOCKER_HOST environment variable is supported. Usage of Docker Contexts for switching environments is not supported. For remote clusters we strongly advise against exposing the TCP socket directly. Instead use the SSH tunneling support of docker cli as described [here](https://docs.docker.com/engine/security/protect-access/).\n\n### Exec into a running service\n\n```bash\ndocker swarmproxy service exec -it vibrant_bell bash\n```\n\nSee all available options:\n\n```bash\ndocker swarmproxy service exec --help\n```\n\n### Use `-` in the command\n\nSince swarmproxy uses click under the hood for argument parsing, you have to use `--` before any exec command.\n\nThis will not work:\n\n```bash\ndocker swarmproxy service exec -it vibrant_bell bash -c 'echo hello'\n```\n\nThis will work:\n\n```bash\ndocker swarmproxy service exec -it vibrant_bell -- bash -c 'echo hello'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuroforgede%2Fdocker-swarm-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuroforgede%2Fdocker-swarm-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuroforgede%2Fdocker-swarm-proxy/lists"}