{"id":19133815,"url":"https://github.com/chazmcgarvey/docker-connect","last_synced_at":"2026-02-15T09:42:17.935Z","repository":{"id":145696193,"uuid":"112047962","full_name":"chazmcgarvey/docker-connect","owner":"chazmcgarvey","description":"Easily connect to Docker sockets over SSH","archived":false,"fork":false,"pushed_at":"2022-10-27T17:05:57.000Z","size":25,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-06T19:23:13.052Z","etag":null,"topics":["docker","docker-machine","ssh"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/chazmcgarvey.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"COPYING","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":"2017-11-26T01:49:57.000Z","updated_at":"2022-10-31T16:59:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f6d6b43-bafc-427f-a457-f2701f6dda23","html_url":"https://github.com/chazmcgarvey/docker-connect","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/chazmcgarvey/docker-connect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chazmcgarvey%2Fdocker-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chazmcgarvey%2Fdocker-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chazmcgarvey%2Fdocker-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chazmcgarvey%2Fdocker-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chazmcgarvey","download_url":"https://codeload.github.com/chazmcgarvey/docker-connect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chazmcgarvey%2Fdocker-connect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29475150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T06:58:05.414Z","status":"ssl_error","status_checked_at":"2026-02-15T06:58:05.085Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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-machine","ssh"],"created_at":"2024-11-09T06:23:55.511Z","updated_at":"2026-02-15T09:42:17.927Z","avatar_url":"https://github.com/chazmcgarvey.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\ndocker-connect - Easily connect to Docker sockets over SSH\n\n# VERSION\n\nVersion 0.82.2\n\n# SYNOPSIS\n\n    docker-connect HOSTNAME [SHELL_ARGS]...\n\n    # launch a new shell wherein docker commands go to staging-01.acme.tld\n    docker-connect staging-01.acme.tld\n\n    # list the docker processes running on staging-01.acme.tld\n    docker-connect staging-01.acme.tld -c 'docker ps'\n\n    # connect as a specific user and a specific port\n    docker-connect myusername@staging-01.acme.tld:2222\n\n# DESCRIPTION\n\nThis script provides an alternative to Docker Machine for connecting your Docker client to a remote\nDocker daemon. Instead of connecting directly to a Docker daemon listening on an external TCP port,\nthis script sets up a connection to the UNIX socket via SSH.\n\nThe main use case for this is when dealing with \"permanent\" app servers in an environment where you\nhave a team of individuals who all need access.\n\nMachine doesn't have a great way to support multiple concurrent users. You can add an existing\nmachine to which you have SSH access using the generic driver on your computer, but if your\ncolleague does the same then Machine will regenerate the Docker daemon TLS certificates, replacing\nthe ones Machine set up for you.\n\nFurthermore, the Docker daemon relies on TLS certificates for client authorization, which is all\nfine and good, but organizations are typically not as prepared to deal with the management of client\nTLS certificates as they are with the management of SSH keys. Worse, the Docker daemon doesn't\nsupport certificate revocation lists! So if a colleague leaves, you must replace the certificate\nauthority and recreate and distribute certificates for each remaining member of the team. Ugh!\n\nMuch easier to just use SSH for authorization.\n\nTo be clear, this script isn't a full replacement for Docker Machine. For one thing, Machine has\na lot more features and can actually create machines. This script just assists with a particular\nworkflow that is currently underserved by Machine.\n\n# HOW IT WORKS\n\nWhat this script actually does is something similar to this sequence of commands:\n\n    ssh -L$PWD/docker.sock:/run/docker.sock $REMOTE_USER@$REMOTE_HOST -p$REMOTE_PORT -nNT \u0026\n    export DOCKER_HOST=\"unix://$PWD/docker.sock\"\n    unset DOCKER_CERT_PATH\n    unset DOCKER_TLS_VERIFY\n\nThis uses [ssh(1)](http://man.he.net/man1/ssh) to create a UNIX socket that forwards to the Docker daemon's own UNIX socket on\nthe remote host. The benefit that `docker-connect` has over executing these commands directly is\n`docker-connect` doesn't require write access to the current directory since it puts its sockets in\n`$TMPDIR` (typically `/tmp`).\n\nIf your local system doesn't support UNIX sockets, you could use the following `ssh` command\ninstead which uses a TCP socket:\n\n    ssh -L2000:/run/docker.sock $REMOTE_USER@$REMOTE_HOST -p$REMOTE_PORT -nNT \u0026\n    export DOCKER_HOST=\"tcp://localhost:2000\"\n\nAn important drawback here is that any local user on the machine will then have unchallenged access\nto the remote Docker daemon by just connecting to localhost:2000. But this may be a reasonable\nalternative for use on non-multiuser machines only.\n\n# REQUIREMENTS\n\n- a Bourne-compatible, POSIX-compatible shell\n\n    This program is written in shell script.\n\n- [OpenSSH](https://www.openssh.com) 6.7+\n\n    Needed to make the socket connection.\n\n- [Docker](https://www.docker.com) client\n\n    Not technically required, but this program isn't useful without it.\n\n# INSTALL\n\nInstall using [BPAN](https://bpan.org/):\n\n    bpan install chazmcgarvey/docker-connect\n\nInstall from the internet using [curl(1)](https://curl.se/):\n\n    # Assuming you have \"$HOME/bin\" in your $PATH:\n    curl -Lo ~/bin/docker-connect \\\n      https://raw.githubusercontent.com/chazmcgarvey/docker-connect/master/bin/docker-connect\n    chmod +x ~/bin/docker-connect\n\nInstall from a checked-out repo:\n\n    git clone https://github.com/chazmcgarvey/docker-connect.git\n    cd docker-connect\n    sudo make install   # install to /usr/local\n\n# ENVIRONMENT\n\nThe following environment variables may affect or will be set by this program:\n\n- `DOCKER_CONNECT_SOCKET`\n\n    The absolute path to the local socket.\n\n- `DOCKER_CONNECT_HOSTNAME`\n\n    The hostname of the remote peer.\n\n- `DOCKER_CONNECT_PID`\n\n    The process ID of the SSH process maintaining the connection.\n\n- `DOCKER_HOST`\n\n    The URI of the local socket.\n\n# TIPS\n\nIf you run many shells and connections, having the hostname of the host that the Docker client is\nconnected to in your prompt may be handy. Try something like this in your local shell config file:\n\n    if [ -n \"$DOCKER_CONNECT_HOSTNAME\" ]\n    then\n        PS1=\"[docker:$DOCKER_CONNECT_HOSTNAME] $PS1\"\n    fi\n\n# AUTHOR\n\nCharles McGarvey \u003cchazmcgarvey@brokenzipper.com\u003e\n\n# LICENSE\n\nThis software is copyright (c) 2018 by Charles McGarvey.\n\nThis is free software, licensed under:\n\n    The MIT (X11) License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchazmcgarvey%2Fdocker-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchazmcgarvey%2Fdocker-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchazmcgarvey%2Fdocker-connect/lists"}