SSH tunnel
Alpine image with the OpenSSH client and autossh, for running SSH tunnels from a container.
registry.gitlab.com/hosstio/docker-images/ssh-tunnel/main:latestSource: hosstio/docker-images/ssh-tunnel
Usage
The image has no entrypoint, so pass ssh or autossh as the command. This forwards port 8080 on the Docker host to port 80 on target, a host that jumphost can reach:
shell
docker run --rm --interactive --tty --publish 8080:8080 registry.gitlab.com/hosstio/docker-images/ssh-tunnel/main:latest \
autossh -M 0 -N -L 0.0.0.0:8080:target:80 user@jumphostThe forward binds 0.0.0.0 because ssh binds 127.0.0.1 by default, which --publish can't reach inside the container. -M 0 turns off autossh's monitoring port, so autossh restarts ssh only when it exits. The image holds no SSH keys, so ssh prompts in the terminal to confirm the host key and for a password.