Sign inSign up

teambun/docker-socket-tunnel

By teambun

•Updated almost 8 years ago

Image
0

236

teambun/docker-socket-tunnel repository overview

⁠Docker Socket Tunnel

A simple docker-machine replacement that take advantage of SSH socket forwarding.

⁠Usage (by manual)

  1. Deploy this on remote machine
docker run -d --restart=always -p 2377:22 \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  -v ~/.ssh/authorized_keys:/root/.ssh/authorized_keys:ro \
  --name docker-socket-tunnel teambun/docker-socket-tunnel
  1. Forward Docker socket
ssh -NTL /tmp/docker.sock:/var/run/docker.sock -p 2377 remote
  1. Connect to remote docker
unset DOCKER_TLS_VERIFY
export DOCKER_HOST=unix:///tmp/docker.sock

docker ps

⁠Usage (by scripts)

  1. Get scripts⁠
  2. Deploy this to remote machine: dockertunnel-init user@remote
  3. Run docker client: dockertunnel user@remote docker ps

Tag summary

Content type

Image

Digest

Size

3.6 MB

Last updated

almost 8 years ago

docker pull teambun/docker-socket-tunnel