Skip to content

Instantly share code, notes, and snippets.

@Rathgore
Last active March 8, 2018 07:00
Show Gist options
  • Save Rathgore/26e1e22130cb0cd4aa2b87b66c009cb8 to your computer and use it in GitHub Desktop.
Save Rathgore/26e1e22130cb0cd4aa2b87b66c009cb8 to your computer and use it in GitHub Desktop.
Forward Docker daemon over SSH

Edit ExecStart in /etc/systemd/system/multi-user.target.wants/docker.service

ExecStart=/usr/bin/dockerd -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock

Forward daemon port over SSH

ssh -L 4243:localhost:4243 <docker-server>

Set DOCKER_HOST on local computer

export DOCKER_HOST=localhost:4243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment