Skip to content

Instantly share code, notes, and snippets.

@beenanner
Created March 30, 2017 19:16
Show Gist options
  • Save beenanner/9f73dc5c86bb5ae9770f98e354f83fc8 to your computer and use it in GitHub Desktop.
Save beenanner/9f73dc5c86bb5ae9770f98e354f83fc8 to your computer and use it in GitHub Desktop.
SSH tunnel to remote host socket
ssh -fNT -L /tmp/remote-docker.sock:/var/run/docker.sock <remote-user>@<host-ip>
Map localhost docker host to ssh tunnel
export DOCKER_HOST=unix:///tmp/remote-docker.sock
@millidavids
Copy link

So this is tunneling the /tmp/remote-docker.sockto the swarm manager /var/run/docker.sock? And any docker commands run from the origin will be tunneled to the swarm manager?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment