|
2 | 2 |
|
3 | 3 | Create a lightweight Alpine Linux based SSH tunnel to a host. Uses pure SSH, no fluff. |
4 | 4 |
|
5 | | -For single TCP port applications (database/webserver/debugging access) a SSH tunnel is far faster and simpler than using a VPN like OpenVPN; see this excellent [blog post](https://blog.backslasher.net/ssh-openvpn-tunneling.html) for more info. |
| 5 | +**Learn more about ssh tunneling [here](https://iximiuz.com/en/posts/ssh-tunnels/))** |
6 | 6 |
|
7 | | -For example I use it to create a SSH tunnel from a GCP Kubernetes cluster into an on prem bastion host in order to talk to an on prem MySQL database; it SSHs onto the internal LAN and connects me to the internal on prem MySQL server. |
8 | | - |
9 | | -Inspired by https://github.com/iadknet/docker-ssh-client-light and [GCP CloudSQL Proxy](https://cloud.google.com/sql/docs/mysql/sql-proxy) |
10 | | - |
11 | | -**FORKED FROM jujhars13/docker-ssh-tunnel/** but reversed the tunnel direction. (more details about tunneling [here](https://iximiuz.com/en/posts/ssh-tunnels/)) |
| 7 | +FORKED FROM jujhars13/docker-ssh-tunnel but reversed the tunnel direction. |
12 | 8 |
|
13 | 9 | ## Required Parameters |
14 | 10 |
|
15 | | -| Variable | Description | Required | |
16 | | -| ------------------ | ----------------------------------------------------------------- | -------- | |
17 | | -| `SSH_PORT` | Port number for SSH (defaults to 22) | No | |
18 | | -| `SSH_USER` | Username for the SSH connection (default: root) | No | |
19 | | -| `CONTAINER_IP` | IP address of the container (default: 127.0.0.1) | No | |
20 | | -| `CONTAINER_PORT` | The port you want to expose on the container (default: 80) | No | |
21 | | -| `REMOTE_IP` | IP/Domain of the machine that will expose your app (the host) | Yes | |
22 | | -| `REMOTE_PORT` | Remote port that will be exposed on the host (default: 80) | No | |
| 11 | +| Variable | Description | default | |
| 12 | +| ------------------ | ------------------------------------------------------------- | ---------- | |
| 13 | +| `SSH_PORT` | Port number for SSH | 22 | |
| 14 | +| `SSH_USER` | Username for the SSH connection | root | |
| 15 | +| `CONTAINER_IP` | IP address of the container | 127.0.0.1 | |
| 16 | +| `CONTAINER_PORT` | The port you want to expose on the container | 80 | |
| 17 | +| `GATEWAY_IP` | IP/Domain of the machine that will expose your app (the host) | (required) | |
| 18 | +| `REMOTE_PORT` | Which port should sshd listen from on the gateway | 80 | |
| 19 | +| `REMOTE_IP` | Which IP should sshd listen from on the gateway (`*` for all) | * | |
23 | 20 |
|
24 | 21 |
|
25 | 22 | Note: Remember to inject/mount your private SSH key into the container to `/ssh_key/id_rsa`. |
|
0 commit comments