Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sigwinhq/docker-ssh-tunnel

Use SSH tunnelling (AKA port forwarding) within your Docker environment to allow your containers to access remote firewalled services by accessing them via known public IPs.
https://github.com/sigwinhq/docker-ssh-tunnel

docker docker-compose docker-image

Last synced: 22 days ago
JSON representation

Use SSH tunnelling (AKA port forwarding) within your Docker environment to allow your containers to access remote firewalled services by accessing them via known public IPs.

Awesome Lists containing this project

README

        

# SSH tunnel in Docker

Use case: allow your Docker containers to use SSH tunnels
to get into those hard to reach places like corporate resources,
firewalled APIs etc.

## Usage with Docker Compose

```yaml
services:
# your reglar services

ssh-tunnel:
image: sigwinhq/ssh-tunnel:latest
environment:
# if the key is password-protected
SSH_AUTH_SOCK: "/ssh-agent"
# the host via which we tunnel
TUNNEL_HOST: "[email protected]"
# what do we want to proxy to?
FORWARD_DSN: "*:443:firewalled-api.example.com:443"
volumes:
# your key is now usable by the tunnel
- $HOME/.ssh:/root/ssh:ro
# if the key is password-protected
- $SSH_AUTH_SOCK:/ssh-agent
# this part is to make the tunnel transparent to others
networks:
default:
aliases:
- firewalled-api.example.com
```

After doing this, your other services should now have access
to the firewalled API as if it's available directly,
without even knowing about the proxy.