This SSH Tunnel provides a simplistic way to set up an SSH tunnel to a remote host to securely connect without having to expose your host too much.
The container assumes your private key doesn't have a password and is mounted
under /private-ssh-key.
- $PORTthe port you want to forward
- $USERNAMEthe username for your ssh key
- $REMOTE_HOSTthe remote host you want to set up a local tunnel for
- $BIND_ADDRESSthe address you want to bind the tunnel to. (default:- 127.0.0.1)
$ docker run --rm -p "9200:9200" \
    -v $(pwd)/private-key:/private-ssh-key \
    -e PORT=9200 \
    -e USERNAME=elasticsearch \
    -e REMOTE_HOST=my-es-host \
    jelmersnoeck/ssh-tunnel