Skip to content

Instantly share code, notes, and snippets.

@aduermael
Created August 17, 2016 21:22
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save aduermael/0991bbde3d0d8008423d945684d9b17c to your computer and use it in GitHub Desktop.
Save aduermael/0991bbde3d0d8008423d945684d9b17c 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! :)

@Dakkaron
Copy link

Dakkaron commented Apr 2, 2019

Thanks! This was very helpful!

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