Skip to content

Instantly share code, notes, and snippets.

@azappella
Forked from aduermael/dockerTunnel.md
Created September 20, 2017 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azappella/a791f5de418a96a74397556490b73068 to your computer and use it in GitHub Desktop.
Save azappella/a791f5de418a96a74397556490b73068 to your computer and use it in GitHub Desktop.
Connect to remote Docker engine through SSH tunnel

Bind remote docker.sock with SSH tunnel:

ssh -nNT -L /tmp/docker.sock:/var/run/docker.sock  <USER>@<IP> &

Set environment variable for local Docker client:

export DOCKER_HOST=unix:///tmp/docker.sock

That's it! :)

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