https://github.com/rimelek/docker-ssh-tunnel-lp
forward port from a container to a local port of a machine in a private network
https://github.com/rimelek/docker-ssh-tunnel-lp
docker docker-image ssh-tunnel
Last synced: about 2 months ago
JSON representation
forward port from a container to a local port of a machine in a private network
- Host: GitHub
- URL: https://github.com/rimelek/docker-ssh-tunnel-lp
- Owner: rimelek
- License: mit
- Created: 2017-02-19T00:29:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-19T00:51:20.000Z (over 9 years ago)
- Last Synced: 2025-02-16T08:27:24.533Z (over 1 year ago)
- Topics: docker, docker-image, ssh-tunnel
- Language: Shell
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Description
This is an SSH tunnel to forward port from a container to a local port of a machine in a private network.
It works only with SSH Keys, so you need to mount your keys into the tunnel container.
**Docker Compose Example**
version: '2'
services:
webapp:
restart: always
image: my-webapp-image
ports:
- 80:80
tunnel:
image: rimelek/ssh-tunnel-lp
network_mode: service:webapp
volumes:
- "${HOME}/.ssh:/root/.ssh"
depends_on:
- webapp
environment:
TUNNEL_HOST: "mytunneluser@my.tunnel.host:12345"
TUNNEL_REMOTES: |
mysql.intranet.lan:3306
nonrootuser@apiserver.intranet.lan:443
nonrootuser@dockerhost.intranet.lan:2375:2222
Each line of an ssh tunnel has the following format:
[nonrootuser@]hostname:serviceport[:sshport]