{"id":27525631,"url":"https://github.com/fm-labs/rdocker","last_synced_at":"2026-04-25T21:33:54.758Z","repository":{"id":287922134,"uuid":"965498969","full_name":"fm-labs/rdocker","owner":"fm-labs","description":"Simple, fast, and secure way to connect to remote Docker daemons","archived":false,"fork":false,"pushed_at":"2025-11-02T19:23:52.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-02T21:13:40.066Z","etag":null,"topics":["docker","docker-cli","remote-control","remote-management"],"latest_commit_sha":null,"homepage":"https://fm-labs.github.io/rdocker/","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/fm-labs.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-13T09:51:16.000Z","updated_at":"2025-11-02T19:23:55.000Z","dependencies_parsed_at":"2025-09-12T14:09:36.754Z","dependency_job_id":"a4cb02b0-83ae-43fe-a9f9-c388d5c76bd8","html_url":"https://github.com/fm-labs/rdocker","commit_stats":null,"previous_names":["fm-labs/rdocker"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/fm-labs/rdocker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fm-labs%2Frdocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fm-labs%2Frdocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fm-labs%2Frdocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fm-labs%2Frdocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fm-labs","download_url":"https://codeload.github.com/fm-labs/rdocker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fm-labs%2Frdocker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32278249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-cli","remote-control","remote-management"],"created_at":"2025-04-18T14:27:32.592Z","updated_at":"2026-04-25T21:33:54.753Z","avatar_url":"https://github.com/fm-labs.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rdocker\n\nSimple, fast, and secure way to connect to remote Docker daemons.\n\n\n## How it works\n\nUnder the hood `ssh`, `autossh`, `socat` and `docker` commands \nare wrapped to create a secure and stable tunnel to a remote Docker daemon.\n\nThe `rdocker` script creates tunnels the remote docker daemon socket to a local socket \nand (optionally) exposes the socket via a TCP proxy to the controlling host (localhost),\nwhich allows you to run docker commands on the remote machine as if they were running locally.\n\n\n## Features\n\n- 🔐 **Secure**: Uses SSH to connect to remote Docker daemon.\n- 🚀 **Fast**: Uses a permanent tunnel and the `docker` CLI to interact with the remote Docker daemon.\n- 💪 **Resilient**: Automatically reconnects to the remote Docker daemon if the connection is lost.\n- 🍳 **Simple**: Spin up a tunnel to the remote Docker daemon with a single command.\n- 🪶 **Lightweight**: No need to install any additional software on the remote server.\n- 📦 **Compact**: Only a few hundred lines of code. Docker image is less than 50MB.\n- 💻 **Portable**: Can be run from any machine with SSH access to the remote server.\n- ✅ **Easy to use**: Just use `rdocker` command instead of `docker` to interact with remote Docker daemon.\n\n\n\n## Getting Started\n\n### Prerequisites\n\n- 💻 Local machine\n  - ✅ Docker CLI installed on your local machine.\n  - ✅ SSH client installed on your local machine.\n  - ✅ SSH access to the remote server.\n- 🌐 Remote server\n  - ✅ Docker Engine installed on the remote server.\n  - ✅ SSH server installed on the remote server.\n\n\n### Create a rdocker configuration\n\nTo create a `rdocker` configuration, run the following command:\n\n```bash\nmkdir -p ~/.rdocker\n\ncat \u003c\u003cEOF \u003e ~/.rdocker/remote0.env\nRDOCKER_REMOTE_HOST=remote0.example.com\nRDOCKER_REMOTE_USER=ubuntu\nRDOCKER_REMOTE_SSH_KEY=~/.ssh/id_rsa\nRDOCKER_TCP_ENABLE=1\nRDOCKER_TCP_PORT=12345\nEOF\n```\n\n### Start rdocker tunnel\n\nTo start a `rdocker` tunnel to a remote Docker daemon, run the following command:\n\n```bash\nRDOCKER_CONTEXT=remote0 ./rdocker tunnel-up\n\n# Outputs:\n#-----------------------\n#* RDOCKER_CONTEXT: remote0\n#* RDOCKER_REMOTE_HOST: remote0.example.com\n#* RDOCKER_REMOTE_USER: ubuntu\n#* RDOCKER_REMOTE_SOCKET: /var/run/docker.sock\n#* RDOCKER_LOCAL_SOCKET: /tmp/rdocker-docker.remote0.sock\n#* RDOCKER_HOST: unix:///tmp/rdocker-docker.remote0.sock\n#-----------------------\n#🔐 SSH tunnel established to remote0.example.com\n#🛰️ Local socket: /tmp/rdocker-docker.remote0.sock\n#🛰️ Local tcp proxy: localhost:12345\n#🚀 -\u003e DOCKER_HOST=unix:///tmp/rdocker-docker.remote0.sock\n#🚀 -\u003e DOCKER_HOST=tcp://localhost:12345\n#Successfully created context \"remote0\"\n#Successfully created context \"remote0-tcp\"\n#🔥️ -\u003e docker context use remote0\n#🔥️ -\u003e docker context use remote0-tcp\n#Probing connection ...\n#CONTAINER ID   IMAGE                 COMMAND                  CREATED       STATUS                 PORTS                                       NAMES\n#Docker connection is working\n#Press Ctrl+C to close tunnel and exit.\n\n```\n\n### Access the remote Docker daemon\n\nFrom another terminal, you can now access the remote Docker daemon using either the `rdocker` or `docker` cli command:\n\n#### Using rdocker\n\n```bash\nRDOCKER_CONTEXT=remote0 ./rdocker ps\n```\n\n#### Using docker\n\n```bash\nDOCKER_HOST=unix:///tmp/rdocker-docker.remote0.sock docker ps\n```\n\n#### Using docker context\n\n```bash\ndocker context use remote0\ndocker ps\n```\n\n\n### Start rdocker tunnel using Docker\n\nThe docker instances will expose the remote docker socket to the local machine via TCP. \nThis allows you to run docker commands on the remote machine as if they were running locally.\n\n```bash\ndocker run -it --rm \\\n  -v ~/.ssh:/home/rdocker/.ssh \\\n  -e RDOCKER_REMOTE_HOST=remote0.example.com \\\n  -e RDOCKER_REMOTE_USER=ubuntu \\\n  -p 12345:12345 \\\n  fmlabs/rdocker:latest\n  \n```\n\n\n## Environment Variables\n\n- `RDOCKER_CONTEXT`: Rdocker context. Required.\n- `RDOCKER_REMOTE_HOST`: Remote host to connect to. Required.\n- `RDOCKER_REMOTE_USER`: Remote user to connect to. Required.\n- `RDOCKER_HOME`: Base directory for `rdocker` configurations. Default is `~/.rdocker`.\n- `RDOCKER_DEBUG`: Enable debug mode. Default is `0`.\n- `RDOCKER_TCP_ENABLE`: Enable TCP proxy for the tunneled docker socket. Default is `0`.\n- `RDOCKER_TCP_PORT`: TCP port. Default is `12345`.\n\n\n\n\n## Caveats\n\n### Limited docker compose support\n\nThe `rdocker` script does not fully support `docker-compose` commands (yet).\n\nEspecially the `docker-compose up` command is tricky, when using \nfile mounts, as the `docker-compose` command will try to mount the files\nfrom the local machine to the remote machine, which will not work.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffm-labs%2Frdocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffm-labs%2Frdocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffm-labs%2Frdocker/lists"}