{"id":19396041,"url":"https://github.com/ruanbekker/docker-remote-tunnel","last_synced_at":"2025-04-24T05:30:51.707Z","repository":{"id":139706849,"uuid":"174848121","full_name":"ruanbekker/docker-remote-tunnel","owner":"ruanbekker","description":"Run Remote Docker commands via a SSH Tunnel","archived":false,"fork":false,"pushed_at":"2020-04-25T23:41:49.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-17T02:14:42.338Z","etag":null,"topics":["cicd","devops","devops-tools","docker","docker-swarm","ssh","ssh-tunnel","tooling"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruanbekker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-03-10T16:13:51.000Z","updated_at":"2024-02-18T15:43:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"7064cc3d-79e3-4eb5-803b-e0e9b127bb02","html_url":"https://github.com/ruanbekker/docker-remote-tunnel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fdocker-remote-tunnel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fdocker-remote-tunnel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fdocker-remote-tunnel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fdocker-remote-tunnel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruanbekker","download_url":"https://codeload.github.com/ruanbekker/docker-remote-tunnel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250572141,"owners_count":21452325,"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":["cicd","devops","devops-tools","docker","docker-swarm","ssh","ssh-tunnel","tooling"],"created_at":"2024-11-10T10:33:20.126Z","updated_at":"2025-04-24T05:30:51.698Z","avatar_url":"https://github.com/ruanbekker.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-remote-tunnel \n\n[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/ruan.ru.bekker@gmail.com) [![](https://images.microbadger.com/badges/image/ruanbekker/docker-remote-tunnel.svg)](https://microbadger.com/images/ruanbekker/docker-remote-tunnel \"Get your own image badge on microbadger.com\") [![](https://images.microbadger.com/badges/version/ruanbekker/docker-remote-tunnel.svg)](https://microbadger.com/images/ruanbekker/docker-remote-tunnel \"Get your own version badge on microbadger.com\") ![](https://img.shields.io/docker/pulls/ruanbekker/docker-remote-tunnel.svg)\n\n\nRun Remote Docker commands via a SSH Tunnel\n\n## Docker Remote Tunnel\n\nRun Remote Docker commands via a SSH Tunnel. [Docker Hub: ruanbekker/docker-remote-tunnel](https://hub.docker.com/r/ruanbekker/docker-remote-tunnel)\n\n## Description\n\nI made this wrapper to simplify ci/cd deployments with concourse to deploy applications to docker swarm.\n\nThe wrapper creates a screen session, creates a ssh tunnel and mounting a local port to the docker socket on the manager node, allowing us to run docker commands locally, interfacing with the remote docker api.\n\n## Usage:\n\nRun a container, and map the path to your ssh key \n\n```\n$ docker run -v ~/.ssh/id_rsa:/tmp/key -it ruanbekker/docker-remote-tunnel sh\n```\n\nWrapper supports creating and terminating the tunnels:\n\n```\n$ docker-tunnel --help\n\nUsage: /usr/bin/docker-tunnel\nDescription: Execute remote docker commands via ssh tunnel over a docker socket\n\n -h, --help                    Display usage instructions\n -c, --connect [user@foo.bar]  Establishes Tunnel to Remote SSH Server. Expects username@remote-server\n -t, --terminate               Terminates Tunnel\n```\n\nEstablish a SSH Tunnel to your Manager node:\n\n```\n$ docker-tunnel -c root@manager.docker.example.com\n\n  Source the environment either with:\n\n  1) source /root/.docker-tunnel.sh\n  2) export DOCKER_HOST=\"localhost:2376\"\n\n```\n\nSource the environment:\n\n```\n$ source /root/.docker-tunnel.sh\n```\n\nValidate that the DOCKER_HOST variable has been set:\n\n```\n$ env | grep DOCKER\nDOCKER_HOST=localhost:2376\n```\n\nRun a docker command from the container:\n\n```\n$ docker node ls\nID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION\n9kbmvcr73ceh2afozxrwx3CzT *   swarm-manager-1     Ready               Active              Leader              18.06.3-ce\nvuxEvsv09qvRekwcltk7prmkx     swarm-worker-1      Ready               Active                                  18.06.3-ce\n```\n\nTerminate the tunnel:\n\n```\n$ docker-tunnel --terminate\n```\n\nVerify that the tunnel has been terminated:\n\n```\n$ docker node ls\nCannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?\n```\n\n## Docker Hub Image\n\n- [Docker Hub: ruanbekker/docker-remote-tunnel](https://hub.docker.com/r/ruanbekker/docker-remote-tunnel)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanbekker%2Fdocker-remote-tunnel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruanbekker%2Fdocker-remote-tunnel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanbekker%2Fdocker-remote-tunnel/lists"}